Answer the question
In order to leave comments, you need to log in
Why is Codeiginter mail not being sent?
Hello everyone, I'm trying to send a letter from the site, but it does not come, I've been sitting for 2 hours, I've broken my head. I tried to send both in the controller and in the model, and simply by writing and stuffing it into the function, and all to no avail. This is what the test send code looks like
$this->load->library('email');
$this->email->from('[email protected]');
$this->email->to('[email protected]');
$this->email->subject('sbj');
$this->email->message('msg');
if( !$this->email->send() ) {
echo 'NO';
echo $this->email->print_debugger();
}
<?php
$config['protocol'] = 'mail';
$config['charset'] = 'utf-8';
$config['priority'] = '1';
Answer the question
In order to leave comments, you need to log in
What does print_debugger() return and what is in the mail server logs? And try this configuration
$this->email->initialize (array (
'mailtype' => $mailtype,
'charset' => $charset,
'useragent' => 'PHPSender',
'protocol' => 'smtp',
'smtp_host' => $host,
'smtp_port' => 25,
//'mailpath' => '/sbin/sendmail',
/**'smtp_user' => '',
'smtp_pass' => '',*/
));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question