使用CodeIgniter发送电子邮件时出错 [英] Error while sending an email with CodeIgniter
问题描述
在发送电子邮件时,我收到了一堆这样的错误:
遇到PHP错误
严重性:注意
消息:fwrite():发送12个字节失败,errno = 32断开的管道
文件名:libraries / Email.php
行号:1846
遇到PHP错误
严重性:注意
消息:fwrite():send 39字节失败,errno = 32断开的管道
文件名:libraries / Email.php
行号:1846
遇到PHP错误
严重性:注意
消息:fwrite():发送31个字节失败,errno = 32断开的管道
文件名:libraries / Email.php
行号:1846
我按照CodeIgniter用户指南进行配置SMTP:
$ config ['protocol'] ='smtp';
$ config ['smtp_host'] ='ssl0.ovh.net';
$ config ['smtp_port'] ='465';
$ config ['smtp_timeout'] ='10';
$ config ['smtp_user'] ='postmaster%example.com';
$ config ['smtp_pass'] ='password';
$ config ['mailtype'] ='html';
$ config ['charset'] ='utf-8';
$ config ['newline'] =\r\\\
;
$ config ['useragent'] ='项目';
看起来配置文件很好,正确(我检查了OVH的电子邮件配置
对您的网站使用cpanel smtp限制是问题,并导致此错误。
SMTP限制
$ b b此功能可防止用户绕过邮件服务器发送
邮件,这是垃圾邮件发件人使用的常见做法。它将仅允许MTA,
mailman和root连接到远程SMTP服务器。
此控件在调整设置中也可调整。
此设置已更新。
SMTP限制已停用。
我有一个类似的问题,不得不禁用SMTP限制。
之后,所有的确定。
While sending an email, I'm receiving a bunch of such errors:
A PHP Error was encountered
Severity: Notice
Message: fwrite(): send of 12 bytes failed with errno=32 Broken pipe
Filename: libraries/Email.php
Line Number: 1846
A PHP Error was encountered
Severity: Notice
Message: fwrite(): send of 39 bytes failed with errno=32 Broken pipe
Filename: libraries/Email.php
Line Number: 1846
A PHP Error was encountered
Severity: Notice
Message: fwrite(): send of 31 bytes failed with errno=32 Broken pipe
Filename: libraries/Email.php
Line Number: 1846
I have followed the CodeIgniter user guide to configure an SMTP:
$config['protocol']='smtp';
$config['smtp_host']='ssl0.ovh.net';
$config['smtp_port']='465';
$config['smtp_timeout']='10';
$config['smtp_user']='postmaster%example.com';
$config['smtp_pass']='password';
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['useragent'] = 'Project';
It seems like the configuration file is just fine, and correct (I've checked the OVH's email configuration files).
Any solution for that?
If you are using cpanel for your website smtp restrictions are problem and cause this error.
SMTP Restrictions
This feature prevents users from bypassing the mail server to send mail, a common practice used by spammers. It will allow only the MTA, mailman, and root to connect to remote SMTP servers.
This control is also adjustable in Tweak Settings.
This setting has been updated.
The SMTP restriction is disabled.
I had a similar problem and had to disable SMTP Restrictions. After that all was ok.
这篇关于使用CodeIgniter发送电子邮件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!