Swiftmailer won't send email, but a SMTP client will
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. el开发者_如何学JAVAapsed, connection closed Sat Jun 04 23:39:20 2011
Check configuration for the dev environment, the switfmailer delivery_strategy option is set to none, inside factories.yml.
精彩评论