I recently updated to Laravel 9 and now I can no longer send emails. In the changelog it was written that they switched the mailer from SwiftMailer to Symfony, so maybe that's the source of the problem. This is the error text I receive whenever I try to send a message:
SymfonyComponentMailerExceptionTransportException: Unable to write bytes on the wire. in file C:OpenServerdomainsminecraftstoragevendorsymfonymailerTransportSmtpStreamAbstractStream.php on line 46
I configured my .env and config/mail.php files according to the documentation. I'm sure everything about this is correct. For the SMTP server I use MailTrap, so the mail configuration is taken from there. I spent two days trying to solve this problem, searching on the internet without success. Reinstalling the Composer dependencies didn't help either.
The following is my .envmail configuration:
MAIL_MAILER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=************** MAIL_PASSWORD=************** MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS="noreply@example.com" MAIL_FROM_NAME="${APP_NAME}"
P粉2421267862023-11-10 16:10:19
I finally found the solution. The problem is that my internet provider is blocking the smtp connection somehow. So when I switched from Wifi to mobile data, it suddenly started working. Hope this helps others with similar issues.