Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using inbuilt template of Login System in Laravel 5.1

When I use Forgot Password on localhost, everything works. Below are my keys in .env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=userid
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls

When I try the same thing on Godaddy server, I am facing the below error.

Swift_TransportException in StreamBuffer.php line 265: Connection could not be established with host smtp.gmail.com [Connection refused

111]

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
532 views
Welcome To Ask or Share your Answers For Others

1 Answer

Your env file must be like below

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=465
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=ssl

In your config/mail.php, the from value should be like below...

'from' => ['address' => 'pankaj@YourDomainName.com', 'name' => 'Sender Name'],

What's your domain Name in from ? or you can say, How to create Email account in GoDaddy ?

  1. Login in your GoDaddy Account
  2. Go to your Hosting Account.
  3. Click Manage
  4. Under Email category, Please click Accounts
  5. Create an account if there is no email account.

and that's it.

So let's say you have email address like Pankaj@yourdomainname.com

Now, put this email address in config/mail.php for from field. That's it.

This will 100% fix the issue


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...