Question: yii2 how to send email?
Answer: To send an email, you may use the following code: Yii::$app->mailer->compose('contact/html', ['contactForm' => $form]) ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject) ->send(); See also http://swiftmailer.org.