Google SMTP 和 CodeIgniter 的问题
我看到很多其他人也遇到过这个问题。
我已经使用 Google Mail 服务器设置了一个电子邮件表单来发送电子邮件。这在我的本地计算机上有效,但是一旦我将其放在服务器上,我就会收到此错误
The following SMTP error was encountered: 110 Connection timed out
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:
Unable to send data: User-Agent: CodeIgniter Date: Thu, 2 Feb 2012 14:24:43 +0000
这是我在 CI 中的设置
$config = array (
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_user' => 'emial',
'smtp_pass' => 'password',
'smtp_port' => '465',
'protocol' => 'smtp',
'charset' => 'utf-8',
'mailtype' => 'html',
'wordwrap' => TRUE
);
我尝试使用端口465和587以及ssl:/ /smtp.googlemail.com 和 tls://smtp.googlemail.com
任何帮助让这项工作都将是伟大的。
I have seen a lot of other people had this issue.
I have setup an email form using the Google Mail server to send the email. This worked on my local machine, but once i put it on the server i get this error
The following SMTP error was encountered: 110 Connection timed out
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:
Unable to send data: User-Agent: CodeIgniter Date: Thu, 2 Feb 2012 14:24:43 +0000
Here is the setup i have in CI
$config = array (
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_user' => 'emial',
'smtp_pass' => 'password',
'smtp_port' => '465',
'protocol' => 'smtp',
'charset' => 'utf-8',
'mailtype' => 'html',
'wordwrap' => TRUE
);
I have tried using both port465 and 587, and both ssl://smtp.googlemail.com and tls://smtp.googlemail.com
Any help getting this working would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将以下行添加到您的电子邮件配置中:
Add the following line to your email config:
我认为最好不要更改框架的核心文件。
就我而言,
这不起作用,但添加
到发送电子邮件的方法以某种方式完成了工作。
I think it is better if you do not change core files of framework.
In my case
didn't work but adding
to the method sending an email somehow did the job.
我遇到了类似的问题,我可以通过将
system/libraries/Email.php
中的$newline
更改为以文本形式发送>\r\n
I was having a similar problem and I was able to send as
text
by changing$newline
insystem/libraries/Email.php
to\r\n