[英]codeigniter email sent to spam
我的模特:
<?php
class email_model extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
}
public function sendEmail($from = null, $to = null, $subject = null, $message = null){
$this->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);
$this->email->from('email@mydomain.com', 'Website name');
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($message);
$this->email->send();
}
}
我的域名托管在GoDaddy上,我在那里也创建了一封电子邮件,并将其重定向到我的Gmail电子邮件...
为什么我的电子邮件发送到垃圾邮件文件夹而不是收件箱中?
编辑:我的电子邮件内容基本上是邀请函
Hello $email
$website has invited you to join the website
to join visit the following link
$link_goes_here
Thanks, the team
如果使用HTML来显示邮件,则必须确保使用有效的html发送邮件。 您可以在此处验证您的邮件: http : //validator.w3.org/
如果是这样,请与我们联系。.也许您可以尝试通过Amazon SES发送电子邮件,所以google / yahoo认为它不是垃圾邮件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.