laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.29k stars 10.94k forks source link

Illuminate\\Mail\\Mailer->send() throws exception when mail server returns unexpected response code #51994

Closed jlinhart-savrx closed 3 months ago

jlinhart-savrx commented 3 months ago

Laravel Version

10.10

PHP Version

8.2.16

Database Driver & Version

No response

Description

Mail::send() throws an exception despite the documentation on Laravel.com never showing exception handling nor the auto-gen docs specifying one. This is the result of a call to the Symfony mailer

#0 ..symfony/mailer/Transport/Smtp/SmtpTransport.php(197): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->assertResponseCode()
#1 ...symfony/mailer/Transport/Smtp/EsmtpTransport.php(118): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->executeCommand()
#2 ...symfony/mailer/Transport/Smtp/SmtpTransport.php(233): Symfony\\Component\\Mailer\\Transport\\Smtp\\EsmtpTransport->executeCommand()
#3 ...vendor/symfony/mailer/Transport/AbstractTransport.php(69): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->doSend()
#4 ...vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(137): Symfony\\Component\\Mailer\\Transport\\AbstractTransport->send()
#5 ...vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(573): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->send()
#6 ...laravel/framework/src/Illuminate/Mail/Mailer.php(335): Illuminate\\Mail\\Mailer->sendSymfonyMessage()
#7 ...laravel/framework/src/Illuminate/Mail/Mailable.php(205): Illuminate\\Mail\\Mailer->send()

Steps To Reproduce

  1. configure an email server
  2. set up mail configuration to use it properly
  3. cause the server to return an unexpected error code

-or-

  1. Configure an email server with no SMTP (O365 has SMTP disabled by default if that helps)
  2. set up mail config to use SMTP
  3. Attempt to send an email
driesvints commented 3 months ago

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.

Thanks!