[英]Gmail SMTP using CodeIgniter
我正在使用以下設置通過CodeIgniter郵件類庫發送Gmail SMTP郵件:![gmail設置] [1]
Mail Server* : smtp.gmail.com
Username* : my@gmail.com
Password* : **********
Port* : 567
SMTP_crypto* : TLS
From Address* : my@gmail.com
Reply To* : my@gmail.com
但是它給了我以下錯誤:
遇到以下SMTP錯誤:110連接超時無法發送數據:AUTH LOGIN無法發送AUTH LOGIN命令。 錯誤:無法發送數據:MAIL FROM:來自:遇到以下SMTP錯誤:無法發送數據:RCPT TO:至:遇到以下SMTP錯誤:無法發送數據:DATA數據:遇到了以下SMTP錯誤:無法發送數據:用戶代理:CodeIgniter日期:2014年11月11日,星期二12:11:22 +0300來自:“ GALTech Staffs”返回路徑:答復:“ GALTech Staffs”收件人:xxxx@gmail.com主題:=?utf-8?Q? 1.0 Content-Type:text / html; charset = utf-8 Content-Transfer-Encoding:引用可打印版權所有©2014郵件系統,保留所有權利。
無法發送數據:。
遇到以下SMTP錯誤:無法使用PHP SMTP發送電子郵件。 您的服務器可能未配置為使用此方法發送郵件。 用戶代理:CodeIgniter日期:2014年11月11日,星期二12:11:22 +0300來自:“ GALTech Staffs”返回路徑:回復:“ GALTech Staffs”收件人:xxxx@gmail.com主題:=?utf- 8?Q?Hello_Reena?= X-發件人:xxxx@gmail.com X-Mailer:CodeIgniter X-優先級:1(最高)消息ID:<5461d2baf3ee2@gmail.com> Mime版本:1.0
內容類型:text / html; charset = utf-8 Content-Transfer-Encoding:引用可打印
你好里納
版權所有©2014 Mailing System,保留所有權利。
將端口587與TLS結合使用,或將端口465與SSL結合使用。
在一個函數中嘗試發送郵件:
希望它能起作用!
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'abc@gmail.com',
'smtp_pass' => 'abcd',
);
$message = 'Your mail message here.';
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->clear();
$this->email->from('abc@gmail.com');
$this->email->to('abc@gmail.com'); //To whom you are sending.
$this->email->subject('Your mail subject');
$this->email->message($message);
if($this->email->send())
{
return true;
}
else
{
return false;
}
}
實際上,這是庫編碼錯誤。 我已經使用以下鏈接修復了該問題: https : //github.com/ivantcholakov/codeigniter-phpmailer
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.