Email class doesn't work |
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 ?
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 )
(03-03-2017, 03:19 PM)InsiteFX Wrote: Did you set your base_url in ./application/config/config.php ? Read the error @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
If you restore the missing (default) error viewfile you will proberbly see an error message explaining why you can't send emails.
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 )
(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 ? 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 (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 ;-) |
Welcome Guest, Not a member yet? Register Sign In |