1

我无法让 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->email->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.

您可以在此处查看有关 pastebin 的完整错误http://pastebin.com/y9UeaEGY

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

我很感激你能提供的任何帮助。谢谢

4

1 回答 1

3

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

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

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

于 2012-11-07T14:49:16.173 回答