簡體   English   中英

盡管在php.ini中啟用了ssl,但無法使用codeigniter和gmail發送郵件

[英]Unable to send mail using codeigniter & gmail though ssl enabled in php.ini

我知道這個問題已經發布,但是我找不到我的問題的答案。 我正在使用Codeigniter通過gmail服務器發送電子郵件。 這是用於此任務的代碼片段:

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['mail_path'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = 'my-email@gmail.com';
$config['smtp_pass'] = '******';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '30';
$config['mailtype'] = 'text';
$config['charset'] = 'utf-8';
$config['validate'] = TRUE;
$config['crlf'] = '\r\n';
$config['newline'] = '\n\n';

$this->load->library('email',$config);
$this->email->from('my-email@gmail.com');
$this->email->to('another-email');
$this->email->subject('Validation');

$message = "some message";

$this->email->message($message);

$this->email->send();

我使用$this->email->print_debugger()來顯示錯誤。 這是我收到的消息:

The following SMTP error was encountered: 13 Unable to find the socket transport "ssl" -
did you forget to enable it when you configured PHP?
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error: 
Unable to send data: MAIL FROM:
from: 
The following SMTP error was encountered: 
Unable to send data: RCPT TO:
to: 
The following SMTP error was encountered: 
Unable to send data: DATA
data: 
The following SMTP error was encountered: ...

當然,我在php.ini文件中未注釋與SSL對應的行。

有什么想法嗎 ?

謝謝 :)

有關此主題的NetTuts上有一個很好的教程。 這是它的鏈接: http : //net.tutsplus.com/articles/news/codeigniter-from-scratch-day-3/

源代碼是可下載的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM