Issue
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]
Solution
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 ?
- Login in your GoDaddy Account
- Go to your Hosting Account.
- Click Manage
- Under Email category, Please click Accounts
- 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
Answered By - user5694966
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.