[英]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.