Switfmailer Class

I am trying to send emails using yii2 swiftmailer class , but my emails are stored in @runtime/mail folder .

Mail configuration looks like :


 'mail' => [

            'class' => 'yii\swiftmailer\Mailer',         

        ],

I am using this snippet to send email:


    Yii::$app->mail->compose('contact/html')

                ->setFrom('from@domain.com')

                ->setTo("myemail@address.com")

                ->setSubject("tedst")

                ->send();



How can I actually recive emails in my inbox in a valid email address?

First of all you need to have working sendmail or SMTP relay on the machine where you’re running the code. Then configure mailer to use it: http://www.yiiframework.com/doc-2.0/yii-swiftmailer-mailer.html