Answer the question
In order to leave comments, you need to log in
How to set up sending mail via sendgrid in yii2?
I use this package https://github.com/bryglen/yii2-sendgrid
I want mail to be sent via sendgrid.
in composer
"sendgrid/sendgrid": "2.2.1",
"bryglen/yii2-sendgrid": "1.1.3"
'sendGrid' => [
'class' => 'bryglen\sendgrid\Mailer',
'username' => 'username',
'password' => 'password',
//'viewPath' => '@app/views/mail', // your view path here
],
public function actionTest()
{
$sendGrid = Yii::$app->sendGrid;
$message = $sendGrid->compose('contact/html', ['contactForm' => $form]);
$message->setFrom('[email protected]')
->setTo('[email protected]')
->setSubject('test')
->send($sendGrid);
}
Answer the question
In order to leave comments, you need to log in
in general, I scored on this package and did everything through it according to the instructions https://packagist.org/packages/sendgrid/sendgrid
and what should be in this variable is not clear ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question