I am making a console application which uses the SwiftMail extension to send. Due to our policy, I have two virtual machines, one which serves as a SMTP relay and the other which is the application server. Sending mail manually through telnet to the relay works fine. When using SwiftMail, it's broken.
The headers are returned and there are no entries returned in the $failure
variable for send()
Response of getHeaders()->toString()
Message-ID: <[email protected]>
Date: Wed, 24 Oct 2012 14:50:31 -0400
Subject: [YourSite] Feedback
From: [email protected]
To: [email protected]
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
If I echo the send()
, i get 1
.
boot.php
$app->register(new Silex\Provider\SwiftmailerServiceProvider(), array(
'swiftmailer.options' => array(
'host' => 'ip.host.relay',
'port' => 25,
'encryption' => null,
'auth_mode' => null
),
));
app.php
$message = \Swift_Message::newInstance( )
->setSubject('[YourSite] Feedback')
->setFrom(array('[email protected]'))
->setTo(array('[email protected]'))
->setBody("Message!");
$app['mailer']->send($message, $failures);
When i run a TCP dump on the app server and run the script, there are no SMTP connection made, and there are no errors thrown.
Anyone encounter this before? I don't want to use sendmail or mail, but SMTP due to our application requirements.
app.php
on the app server, and no inbound SMTP on the relay – Ronna