1

我正在尝试使用 swift_smtptransport 发送一封电子邮件,该电子邮件将连接到 127.0.0.1:25 我正在使用以下代码:

$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; 

结果是:array() 0 什么都没有发生,没有异常,什么都没有。

我正在使用水星电子邮件服务器,日志仅显示:

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

但是在我尝试使用雷鸟发送电子邮件后,日志显示:

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
4

1 回答 1

1

检查开发环境的配置,switfmailer delivery_strategy 选项设置为 none,在 factory.yml 中。

于 2012-01-06T22:09:24.843 回答