0

I am trying to build a login/register system in Laravel. I created all the views and controllers autogenerated (Laravel can do this for you with some commands).

The logic of login + register works fine but when I tried to do email verification after I setup everything in .env when I try to register and send email verification I get this error :

fwrite(): send of 18 bytes failed with errno=10054 Une connexion existante a d� �tre ferm�e par l�h�te distant

I am using "mailtrap" which gives u like a fake email to test with it.

This is my .env configuration '''

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME= "username that i have in my mailtrap inbox"
MAIL_PASSWORD= "password that i have in my mailtrap inbox"
MAIL_ENCRYPTION= NULL
MAIL_FROM_ADDRESS=myemail@gmail.com
MAIL_FROM_NAME="${APP_NAME}"

PS. I am following a tutorial on youtube and I did the same steps as him and it works fine for him. I am using Laravel 7. Thank you very much.

James Westgate
  • 10,989
  • 7
  • 61
  • 67
mehdi
  • 1
  • 3
  • check out this thread (not laravel but similar) https://stackoverflow.com/questions/13694351/error-while-sending-an-email-with-codeigniter it looks like a config on your server stopping smtp – Cameron Jul 02 '20 at 01:18
  • thanks i tried the solutions mentioned in the link but none worked for me .. – mehdi Jul 02 '20 at 12:09
  • ps : sometimes the error is : "expected response 250 but got empty" – mehdi Jul 02 '20 at 12:09
  • be sure to run php artisan config:cache when making config / env changes. ``` MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=yourusername MAIL_PASSWORD=yourpassword MAIL_ENCRYPTION=TLS ``` change your from address to example.com (not gmail) just to verify that isn't an issue. get rid of this MAIL_FROM_NAME="${APP_NAME}" for now. – Cameron Jul 02 '20 at 15:06
  • @Cameron .. Thank you sir for your good and well explained answer .. it worked for me without changing "gmail". – mehdi Jul 05 '20 at 12:37

0 Answers0