【问题标题】:SMTP Codeigniter email error '354 End data with .'SMTP Codeigniter 电子邮件错误“354 End data with .”
【发布时间】:2012-10-27 15:14:18
【问题描述】:

我无法让 Codeigniter 电子邮件库在新服务器上运行。

此代码以前可以工作,但最近停止工作,我终其一生都无法弄清楚原因。基本上,这里是代码:

 $this->email->from('example@example.com', 'Intranet');
 $this->email->to($c['email']);//This is def a valid email

 //$name is being obtained from elsewhere

 $this->email->subject('Time manager reminder');
 $this->email->message("
   {$name[0]},
   <br/><br/>You haven’t completed your time for today. Please don’t forget to do so<br/><br/>
   Intranet
  ");

 $this->email->send();

还有 email.php 的配置密码

$config['mailtype'] = "html";
$config['priority'] = 1;
$config['protocol'] = "smtp";

$config['smtp_host'] = "my server..";
$config['smtp_user'] = "u/n";
$config['smtp_pass'] = "p/w";

$config['smtp_timeout'] = 1;
$config['validate'] = true;

我从$this-&gt;email-&gt;print_debugger(); 收到的错误如下:

data: 354 End data with .

The following SMTP error was encountered: 
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this   method.

你可以在这里http://pastebin.com/y9UeaEGY查看pastebin的完整错误

我已将所有地方的电子邮件都划掉了,但我可以向您保证,它们是有效且使用过的电子邮件地址。

如果您能提供任何帮助,我将不胜感激。谢谢

【问题讨论】:

  • 354 可能意味着您的邮件中有一些奇怪的内容。看起来您在邮件中使用的撇号可能不是标准撇号...删除撇号后会发生什么?
  • 嗨。我尝试将“你没有”更改为“你没有”,但仍然产生同样的错误。
  • don't 中有相同的撇号...你都改了吗?
  • 糟糕。是的,也删了。还是没有运气。
  • 您可以尝试使用 sendmail(不是 smtp)发送,还是您的服务器上没有配置?此外,您的 SMTP 超时设置为 1 秒 - 这会截断您的消息吗?如果您将超时更新为喜欢 30 秒进行测试怎么办?

标签: codeigniter email smtp


【解决方案1】:

我找到了原因。显然,在配置中,您需要设置

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

手动在 email.php 文件中。默认情况下,Codeigniter 似乎没有这样做。奇怪:)

【讨论】:

  • 在表达式引擎上是 $config['email_crlf'] = "\r\n";和 $config['email_newline'] = "\r\n";
猜你喜欢
  • 2014-06-07
  • 2014-02-15
  • 2014-10-26
  • 2011-06-12
  • 1970-01-01
  • 2016-06-25
  • 2016-11-15
  • 2012-01-04
  • 2018-12-08
相关资源
最近更新 更多