I use Swiftmailer to send emails in my Symfony 2.5 project. Here is my related code
parameters.yml
parameters:
mailer_transport: smtp
mailer_host: mail.domain.com
mailer_username: user@domain.com
mailer_password: password
mailer_auth_mode: login
config.yml
swiftmailer:
transport: %mailer_transport%
auth_mode: %mailer_auth_mode%
host: %mailer_host%
username: %mailer_username%
password: %mailer_password%
spool: { type: memory }
controller:
$message = \Swift_Message::newInstance()
->setSubject('mana')
->setFrom('***@gmail.com')
->setTo('***@yahoo.com')
->setBody('this is test');
$this->get('mailer')->send($message);
I have swiftmailer in appKernel.php
$bundles = array(
...
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
...
);
The email did not get sent. Can you help me?