i using Mailer to send email, so i have problem about sender name This is my config
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => false,
'messageConfig' => [
'charset' => 'UTF-8',
'from' => ['[email protected]' => 'App Sender Name'],
],
'transport' => [
'class' => 'Swift_MailTransport',
],
],
So it's not work. I goto inbox and only email showed.
And i need show as Example:
it's work when i update setFrom() method. Ex: $mailer->setFrom(['[email protected]' => 'App Name']). And here is config Yii2 for send by PHP mail and with sender name
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => false,
'messageConfig' => [
'charset' => 'UTF-8',
'from' => ['[email protected]' => 'App Sender Name'],
],
'transport' => [
'class' => 'Swift_MailTransport',
],
],
and send email
Yii::$app->mailer->compose()
->setTo('[email protected]')
->setFrom(['[email protected]' => 'App Name'])
....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With