0
votes

The server, Ubuntu 16.04, with Nginx webserver. I am running 2 virtual hosts, both have Laravel apps running. One is Laravel 5.1, the other is 5.4.

I have the same contact us form under both Laravel instances. The sendmail function on the controller is the same for both (I know I need to refactor this functionality off of the controller :-) ) Both have the same config/mail.php settings. .env is the same on both, other than the username and password. Both gmail accounts have insecure applications enabled / allowed.

The one running under Laravel 5.1 works perfectly. The one under 5.4 gives a timeout error when trying to connect to gmail.

Any ideas on what the fix should be?

1
Do you have MAIL_ENCRYPTION set in your .env and is it the same for both?Björn
@Björn It is not set in either. Mail.php default should set it to tls though, right?Roger Creasy
No, mail.php by default is sets tls to null AFAIKLudo237
@ClaudioLudovicoPanetta Ahh, still, both are set up the same. Doesn't make sense to me that one works and the other doesn't, unless swiftmailer differs in the two.Roger Creasy
I haven't used laravel with gmail but try to start from here laracasts.com/discuss/channels/laravel/…Ludo237

1 Answers

1
votes

The solution appears to be related to the Gmail password. The client insisted on an easily remembered password. I changed to a more complex password, and everything worked.

I did read a post that said that Google does not like automated accesses with insecure passwords. Sorry, I cannot reference that post - can't find it again.

Apparently, the solution is to use a secure password. I merely added special characters to the client's desired password.

I hope this helps someone else.