kevinkt
(Kevin)
1
So I looked at the mailing code in Yii
Yii::$app->mailer->compose()
->setFrom('email@email.com')
->setTo($email)
->setSubject('Contest confirmation')
->setTextBody('Plain text content')
->setHtmlBody('<b>HTML content</b>')
->send();
But how do I set the name of the sender and also the reply-to email? Or is that possible?
jacmoe
(Jacob Moen)
2
Use array for ‘setFrom’ :
Yii::$app->mailer->compose()
->setFrom(['email@email.com', 'name'])
->setTo($email)
->[i]setReplyTo($reply-to)[/i]
->setSubject('Contest confirmation')
->setTextBody('Plain text content')
->setHtmlBody('<b>HTML content</b>')
->send();
And use ‘setReplyTo’.
See http://swiftmailer.org/docs/sending.html