I have a symfony app runing on a Debian 7 VM. I'm trying to send mails using swiftMailer. All seems to be fine when running the code but no email is received. What am I missing?
Controller :
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('send@example.com')
->setTo('name.lastname@gmail.com')
->setBody('hello');
$mailer = $this->get('mailer');
if (!$mailer->send($message, $failures)) {
echo "Failures:";
print_r($failures);
return "ko";
} else {
return 'email sent successfully';
}
This is always returning "email sent successfully".
config.yml :
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
#spool: { type: memory }
parameters.yml :
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
php.ini :
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = 127.0.0.1
; http://php.net/smtp-port
smtp_port = 25