无法使用codeigniter和gmail发送邮件,尽管在php中启用了ssl.ini



我知道这个问题已经发布,但我找不到问题的答案。我正在使用代码点火器发送电子邮件,带有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'] = 'rn';
$config['newline'] = 'nn';
$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/

源代码是可下载的。

最新更新