I'm Trying To Send Mails From My Web Server Using SMTP PROTOCOL in codeigniter frame work.my mails was always delivering late and going to spam.i had follow many past conservations,still i didn't solve this problem.help me folks to solve this problem.here is my code:
$config = Array('protocol' => 'smtp',
'smtp_host' => 'http://smtp.tfas.net/',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'xxxxxxx',
'mailtype' => 'html',
'mailpath' => '/usr/sbin/sendmail',
'charset' => 'utf-8'
);
$this->load->library('email', $config);
$this->email->set_newline("
");
if (file_exists($attachment_path))
{
$this->email->attach("$attachment_path");
$this->email->from('[email protected]','TFAS MEMBER PORTAL');
$this->email->reply_to('[email protected]','Help Center');
$this->email->message($message);
$this->email->to($to);
$this->email->subject('Greetings From TFAS Member Portal');
}
else
{
$this->email->from('[email protected]','TFAS MEMBER PORTAL');
$this->email->reply_to('[email protected]','Help Center');
$this->email->message($message);
$this->email->to($to);
$this->email->subject('Greetings From TFAS Member Portal');
}
if($this->email->send())
{
return true;
}
else
{
return false;
}
// Even I had gone through this link https://github.com/ivantcholakov/codeigniter-phpmailer
which is a tutorial to send mails with phpmailer library in codeigniter but same problem araises..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…