|
|
@ -19,7 +19,7 @@ use yii\mail\BaseMailer; |
|
|
|
* ~~~ |
|
|
|
* ~~~ |
|
|
|
* 'components' => [ |
|
|
|
* 'components' => [ |
|
|
|
* ... |
|
|
|
* ... |
|
|
|
* 'mail' => [ |
|
|
|
* 'mailer' => [ |
|
|
|
* 'class' => 'yii\swiftmailer\Mailer', |
|
|
|
* 'class' => 'yii\swiftmailer\Mailer', |
|
|
|
* 'transport' => [ |
|
|
|
* 'transport' => [ |
|
|
|
* 'class' => 'Swift_SmtpTransport', |
|
|
|
* 'class' => 'Swift_SmtpTransport', |
|
|
@ -57,7 +57,7 @@ use yii\mail\BaseMailer; |
|
|
|
* To send an email, you may use the following code: |
|
|
|
* To send an email, you may use the following code: |
|
|
|
* |
|
|
|
* |
|
|
|
* ~~~ |
|
|
|
* ~~~ |
|
|
|
* Yii::$app->mail->compose('contact/html', ['contactForm' => $form]) |
|
|
|
* Yii::$app->mailer->compose('contact/html', ['contactForm' => $form]) |
|
|
|
* ->setFrom('from@domain.com') |
|
|
|
* ->setFrom('from@domain.com') |
|
|
|
* ->setTo($form->email) |
|
|
|
* ->setTo($form->email) |
|
|
|
* ->setSubject($form->subject) |
|
|
|
* ->setSubject($form->subject) |
|
|
|