【发布时间】:2012-05-27 18:40:26
【问题描述】:
我的模特:
<?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
【问题讨论】:
-
取决于您发送的内容,与您用于发送的代码无关。 Gmail 的垃圾邮件过滤器非常好,如果它认为您的电子邮件是垃圾邮件,我很好奇它的内容是什么。
-
考虑看看this solution。
-
同意以上2个cmets,你也不妨看看你之前的问题,在合适的地方选择答案
-
@jeshurun 我已经用电子邮件的内容更新了我的问题
-
可能有很多东西...主题、内容、发件人,甚至是您发送邮件的 IP 地址。 a) 主题、内容和发件人:尝试通过americaint.com/spam-filter-messagetest/spam-checker.html 等工具输入您的电子邮件等内容 b) 转到mxtoolbox.com/blacklists.aspx 并输入您服务器的IP 地址。
标签: php email codeigniter spam