Php 发送到垃圾邮件的codeigniter电子邮件
我的模型:Php 发送到垃圾邮件的codeigniter电子邮件,php,email,codeigniter,spam,Php,Email,Codeigniter,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 =
<?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();
}
}
如果您使用HTML显示邮件,则必须确保您的邮件使用有效的HTML发送。 您可以在此处验证您的邮件:如果需要,请发送联系我们表单。。
也许你可以尝试通过亚马逊SES发送电子邮件,因此谷歌/雅虎并不认为它是垃圾邮件取决于你发送的内容,而与你发送邮件时使用的代码几乎没有关系。Gmail的垃圾邮件过滤器是非常好的,如果它认为你的电子邮件垃圾邮件,我很好奇它的内容是什么。考虑看看。同意上述2个评论,您可能还希望查看之前的问题,并从中选择答案appropriate@jeshurun我已经用电子邮件的内容更新了我的问题。可能有很多事情。。。主题、内容、发件人,甚至是发送源的IP地址。a) 主题、内容和发件人:尝试通过b)转到并输入服务器的IP地址等工具输入电子邮件内容。
Hello $email
$website has invited you to join the website
to join visit the following link
$link_goes_here
Thanks, the team