PHP's mail() function sends mail fine, but Swiftmailer's Swift_MailTransport doesn't work!
This works:
mail('user@example.com', 'test '.date('H:i:s'), '');
But this does not:
$transport = Swift_MailTransport::newInstance('');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('test '.date('H:i:s'))
->setFrom('user@example.com')
->setTo('user@example.com')
->setBody('Testing one two three');
$result = $mailer->send($message);
(The user@example.com
is replaced by a valid email address in my test code.)
The mail logs for both events look very similar in both cases, and it appears that mail is being sent in the latter.
Could there be something about the message constructed by Swiftmailer that is causing it to be blocked by a spam filter?
(By the way, I have tried using the SMTP transport, with no luck; I figured that since mail() works correctly, it would be trivial to switch to Swiftmail's Mail transport...)