我知道此問題已發佈,但無法找到我的問題的答案。 我使用codeigniter通過gmail服務器發送電子郵件。下面是用於此任務的代碼段:雖然在php.ini中啓用ssl,但無法使用codeigniter&gmail發送郵件
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['mail_path'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = '[email protected]';
$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('[email protected]');
$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行...
有什麼想法?
謝謝:)
你的服務器上是否安裝了openssl? – Repox 2012-04-16 09:52:37
我在本地工作,在mac osx上,用macports – mvdb 2012-04-16 09:55:11
我在檢查模塊是否是最新的,謝謝 – mvdb 2012-04-16 09:57:50