CodeIgniter邮件SMTP发送响应超时配置解决方案

问题

本地环境配置 QQ 企业邮箱的 SMTP 后,发送邮件的时候总是一直在等待等待,没有响应。用 php 函数发送的时候则是瞬间完成。在网上找了一下,发现了有类似的问题,提示为:

**Fatal error: Maximum execution time of 60 seconds exceeded in xxx **

即执行超时。是由换行符导致的错误。

解决方法

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

将配置文件中加入以上两个配置属性。

英文论坛原文:http://ellislab.com/forums/viewthread/88690/

I concur with Soar. I was having that Max execution time probleme when trying to send email through SMTP using a Windows 2008 server with MailEnable. I then change my parameters and used my FC6 Unix server with Exam as the MTA and it worked right away.

EDIT: I added these 2 lines:

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

and it started working right away with my Windows server.

CodeIgniter邮件SMTP发送响应超时配置解决方案

https://sh.gg/posts/2012/codeigniter-smtp/

作者

Willin Wang

发布于

2012-12-03

更新于

2022-04-10

许可协议

评论