The PHP mail () function sends mail in order, but Swiftmailer Swift_MailTransport does not work!
It works:
mail(' user@example.com ', 'test '.date('H:i:s'), '');
But this is not so:
$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);
( user@example.com is replaced with a valid email address in my test code.)
The mail logs for both events look very similar in both cases, and it seems that the mail is sent last.
Could there be something in the message generated by Swiftmailer that forces it to block the spam filter?
(By the way, I tried using the SMTP transport, no luck, I realized that since mail () works correctly, it would be trivial to switch to the Swiftmail Mail transport ...)
Sam wilson
source share