SwiftMail does not send my email, and mail() works. Same as here .
I added EchoLogger but didn't print anything.
$message = Swift_Message::newInstance(); $message->setSubject('Test'); $message->setTo( $email ); $message->setFrom(ABSENDER); $message->setBody($nl_text); $transport = Swift_MailTransport::newInstance(); $mailer = Swift_Mailer::newInstance($transport); $logger = new Swift_Plugins_Loggers_EchoLogger(); $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); $result = $mailer->send($message, $failures); var_dump($failures);
The letter returns to $failures , but why?
Update
In Swift_Transport_SimpleMailInvoker::mail I reset the parameters and received the following:
$headers => string(208) "Message-ID: < 1337173064.4fb3a4480b8dd@domain.de > Date: Wed, 16 May 2012 14:57:44 +0200 From: news@domain.de MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable " $extraParams => string(15) " -fnews@domain.de "
$to, $subject, $body is the same as I used in mail() . I donβt know what the problem is yet.
Update # 2
This worked fine for me:
mail($email, 'Test', $nl_text, "From: " . ABSENDER);
Disclaimer This is not a solution, but a workaround that I used because I did not have time to debug the framework and find a real solution. Feel free to use the above information to debug yourself and post your solution here. I will gladly agree and support him.
PiTheNumber
source share