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
Trim Country Code from Phone Number in PHP
Saving Multiple Records in a Laravel Eloquent Create
Getting Data from a Textarea into a Database
Session Id Is Changing After Every Request
How to Fetch Data After Selecting from Dropdown List
How to Set the Default Value of an Attribute on a Laravel Model
Using Maatwebsite Excel 3.1 Export How to Set Background Color for Cells and Font Size for Heading
How to Stop My PHP Form Resubmitting Input After Page Refresh
Showing Image Binary Data Using JavaScript
How to Resolve MySQL Port 3306 Error on Wamp
Combining 'Where' and 'Like' Statements by Using the Ci Activerecords
How to Update Multiple Select Box Values in PHP MySQL
Object of Class Mysqli_Result Could Not Be Converted to String
Redirect That Same Page from Where Id Is Coming
How to Get Foreach Loop Variable Outside of Loop
How to Get the Url of Currently Opened Tabs in All Browsers With PHP or JavaScript
What Does the PHP Error Message "Notice: Use of Undefined Constant" Mean