I'm using swift_mailer to handle sending emails and I'm having a problem which is emails are not sent, and the return value of the send
method is always equal to zero.
<kbd>app/config/config.yml</kbd>
swiftmailer:
transport: smtp
host: <host> # of the company
username: <username> # of the company
password: <password> # of the company
port: 25
<kbd>app/config/config_test.yml</kbd>
swiftmailer:
disable_delivery: true
# disable_delivery: ~ # tried with this too
<kbd>Controller</kbd>
$mailer = $this->get('mailer');
$message = $mailer->createMessage()
->setSubject('You have Completed Registration!')
->setFrom('send@example.com')
->setTo('valid_email@Iswear.fr')
->setBody(
'hello world!!',
'text/plain'
)
var_dump($mailer->send($message, $failed), $failed); exit;
Output:
int(0)
array(0) {
}
I know that send returns the number of persons the email has been sent to. Why the email is never sent? Given that I'm sure of the only email address I'm trying to send to.
Update1:
I'd like to know how to debug this much further.