• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email class doesn't work

#1
Hi, 

I'm actually trying to use Email class for sending mail, but when i try it, this message appear: 

Warning: include(C:\wamp64\www\onsen\application\views\errors\html\error_php.php): failed to open stream: No such file or directory in C:\wamp64\www\onsen\system\core\Exceptions.php on line 269


I've already use it before with a oldest version of Codeigniter and everything work good.
I'm actually working with 3.1.3 Codeigniter'version.

There is m'y controller: 

function sendMail()
{

$nom = $this->input->post('name');
$mail = $this->input->post('email');
$sujet = $this->input->post('subject');
$message = $this->input->post('message');


$config = Array(
   'protocol' => 'smtp',
   'smtp_host' => 'smtp.numericable.be',
   'smtp_port' => 25,
   'smtp_user' => '',
   'smtp_pass' => '',
   'mailtype'  => 'html',
   'newline' =>"\r\n",
   'charset'   => 'UTF-8'
);

$this->load->library('email', $config);

$this->email->set_newline("\r\n");

$this->email->from($mail, $nom);
$this->email->to('******@outlook.com'); 

$this->email->subject($sujet);
$this->email->message(
'Message: ' .$message. '<br>'
);

$this->email->send();




//$this->load->view('onsen/contact');
redirect('contact');
}


If anyone else have the same problem ?
Reply

#2
Did you set your base_url in ./application/config/config.php ?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(03-03-2017, 03:19 PM)InsiteFX Wrote: Did you set your base_url in ./application/config/config.php ?

Yes i did it: $config['base_url'] = 'http://localhost/onsen'; where 'onsen' is the name my class (class onsen extends CI_Controller)  Undecided Undecided
Reply

#4
(03-03-2017, 03:19 PM)InsiteFX Wrote: Did you set your base_url in ./application/config/config.php ?

Read the error Dodgy


@dashing

Warning: include(C:\wamp64\www\onsen\application\views\errors\html\error_php.php): failed to open stream: No such file or directory in C:\wamp64\www\onsen\system\core\Exceptions.php on line 269

The Exceptions.php miss the error_php.php
Reply

#5
If you restore the missing (default) error viewfile you will proberbly see an error message explaining why you can't send emails.
Reply

#6
Your also missing the ending / slash on your base_url
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#7
(03-03-2017, 11:28 PM)Paradinight Wrote:
(03-03-2017, 03:19 PM)InsiteFX Wrote: Did you set your base_url in ./application/config/config.php ?

Read the error  Dodgy


@dashing

Warning: include(C:\wamp64\www\onsen\application\views\errors\html\error_php.php): failed to open stream: No such file or directory in C:\wamp64\www\onsen\system\core\Exceptions.php on line 269

The Exceptions.php miss the error_php.php

Thank you, i have finally find the solution to resolve it. Some files was missing (like error_php.php, error_general.php). Those files helped me to find where was the errors  Rolleyes
Reply

#8
(03-04-2017, 12:46 AM)Diederik Wrote: If you restore the missing (default) error viewfile you will proberbly see an error message explaining why you can't send emails.

It's work now, thank you. I have restored some missing files (error_php.php and error_general.php), thanks to them i have find the solution ;-)
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.