Connection Could Not Be Established With Host Smtp.Gmail.Com [Connection Refused #111] in Laravel 5.6 Email Send

Connection could not be established with host smtp.gmail.com [Connection refused #111] in laravel 5.6 email send

Problem Solved.
I made the change two things here MAIL_DRIVER and MAIL_PORT.

MAIL_DRIVER=sendmail
MAIL_PORT=587

So, my full code is:

MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl

It works fine

PHP on GoDaddy Linux Shared trying to send through GMAIL SMTP

As discussed previously, GoDaddy has been known to block outgoing SSL SMTP connections in favor of forcing you to use their own outgoing mail server.

This is pretty much the tip of the iceberg, with regard to the immense suckitude of GoDaddy as a company, registrar and web host. Ditch'em.

PHP Laravel: No connection could be made because the target machine actively refused it

I changed the ip address specified in the homestead.yaml from localhost to 192.168.10.10. Then I ran homestead provision and that seemed to fix the problem. The host machine cannot resolve localhost or 127.0.0.1 because that is already mapped to itself.

Access denied for user 'homestead'@'localhost' (using password: YES)

Check MySQL UNIX Socket

Find unix_socket location using MySQL

mysql -u homestead -p

mysql> show variables like '%sock%';
+-----------------------------------------+-----------------------------+
| Variable_name | Value |
+-----------------------------------------+-----------------------------+
| performance_schema_max_socket_classes | 10 |
| performance_schema_max_socket_instances | 322 |
| socket | /var/run/mysqld/mysqld.sock |
+-----------------------------------------+-----------------------------+
3 rows in set (0.00 sec)

Then I go to config/database.php

I update this line : 'unix_socket' => '/tmp/mysql.sock',

to : 'unix_socket' => '/var/run/mysqld/mysqld.sock',

That's it. It works for my as my 4th try.I hope these steps help someone. :D



Related Topics



Leave a reply



Submit