Yii 2.0: Email sent "successful" with no configuration

If I have no mailer configuration specified, and I use the Yii::$app->mailer->send(), it returns true, and the email logs say the message was successfully sent. Is this because useFileTransport is true by default, and if an EML file is created, Yii has technically sent the email?

yes. To send real email, you have to set useFileTransport to false.

Hi,

your messages have been written into a file. If true is set for the ‘useFileTransport’ option Yii will send messages to a file. Read more http://www.yiiframework.com/doc-2.0/yii-mail-basemailer.html#$useFileTransport-detail.

In order to take a look at saved messages go to the GII module and check "mail panel". It should show you the lost emails :wink:

Cheers,

Andrzej