Google SMTP 和 CodeIgniter 的问题

发布于 2025-01-02 06:58:04 字数 1040 浏览 2 评论 0原文

我看到很多其他人也遇到过这个问题。

我已经使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

|煩躁 2025-01-09 06:58:04

将以下行添加到您的电子邮件配置中:

$config['newline'] = "\r\n";

Add the following line to your email config:

$config['newline'] = "\r\n";
謸气贵蔟 2025-01-09 06:58:04

我认为最好不要更改框架的核心文件。

就我而言,

$config['newline'] = "\r\n";

这不起作用,但添加

$this->email->set_newline("\r\n");

到发送电子邮件的方法以某种方式完成了工作。

I think it is better if you do not change core files of framework.

In my case

$config['newline'] = "\r\n";

didn't work but adding

$this->email->set_newline("\r\n");

to the method sending an email somehow did the job.

冷︶言冷语的世界 2025-01-09 06:58:04

我遇到了类似的问题,我可以通过将 system/libraries/Email.php 中的 $newline 更改为 以文本形式发送>\r\n

I was having a similar problem and I was able to send as text by changing $newline in system/libraries/Email.php to \r\n

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文