Make sure that you have a sender address set. Swiftmailer works without it (laravel 8) while symfony mailer does not (laravel 9)
Jun 24, 2022
8
Level 1
Address::__construct(): Argument #1 ($address) must be of type string, null given
hi everyone, I am having this problem when I try to send the verification email to the user.
This problem started when upgrading to Laravel 9. Checking my mail.php configuration I see that I have multiple email accounts through which I send email. I think the problem is there but I can't figure it out.
'mailers' => [
'support' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME_SUPPORT'),
'password' => env('MAIL_PASSWORD_SUPPORT'),
'name' => env('MAIL_NAME_SUPPORT'),
'timeout' => null,
'auth_mode' => null,
],
'mailing' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME_MAILING'),
'password' => env('MAIL_PASSWORD_MAILING'),
'from' => [
'address' => env('MAIL_FROM_ADDRESS_MAILING'),
'name' => env('MAIL_FROM_NAME_MAILING'),
],
'timeout' => null,
'auth_mode' => null,
],
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
],
Level 102
@Mav23Sa the env data you posted, was that from production? Make sure it has all the same variables set, and then redo your cache on production with php artisan config:cache
Please or to participate in this conversation.