dongyong2906 2011-06-04 20:57
浏览 77
已采纳

Swiftmailer不会发送电子邮件,但SMTP客户端会发送

I'm trying to send an email using swift_smtptransport that will connect to 127.0.0.1:25 I'm using the following code:

$message = Swift_Message::newInstance();

$message->setSubject('Test mail');
$message->setFrom('admin@localhost');
$message->setTo('peter@localhost');
$message->setBody('Test message');

$num = $this->getMailer()->send($message, $failures);

print_r($failures);

echo $num; 

The result is: array() 0 as nothing happend, no exception, no nothing.

I'm using mercury email server and the log says only:

Connection from 127.0.0.1, Sat Jun 04 23:46:56 2011
EHLO [127.0.0.1]
QUIT
0 sec. elapsed, connection closed Sat Jun 04 23:46:56 2011

but after I've tried to send an email with thunderbird the log says:

Connection from 127.0.0.1, Sat Jun 04 23:39:20 2011
EHLO [127.0.0.1]
MAIL FROM:<peter@localhost> SIZE=381
RCPT TO:<peter@localhost>
DATA
DATA - 11 lines, 381 bytes.
QUIT
0 sec. elapsed, connection closed Sat Jun 04 23:39:20 2011
  • 写回答

1条回答 默认 最新

  • doudun6928 2012-01-06 22:09
    关注

    Check configuration for the dev environment, the switfmailer delivery_strategy option is set to none, inside factories.yml.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 slam rangenet++配置
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊