When I try send mail on the staging server, it display error like this :
Swift_TransportException in StreamBuffer.php line 268:
Connection could not be established with host smtp.gmail.com [Connection timed out #110]
in StreamBuffer.php line 268
at Swift_Transport_StreamBuffer->_establishSocketConnection() in StreamBuffer.php line 62
at Swift_Transport_StreamBuffer->initialize(array('protocol' => 'tcp', 'host' => 'smtp.gmail.com', 'port' => '587', 'timeout' => '30', 'blocking' => '1', 'tls' => true, 'type' => '1', 'stream_context_options' => array())) in AbstractSmtpTransport.php line 113
at Swift_Transport_AbstractSmtpTransport->start() in Mailer.php line 79
at Swift_Mailer->send(object(Swift_Message), array()) in Mailer.php line 395
at Mailer->sendSwiftMessage(object(Swift_Message)) in Mailer.php line 217
...
I try all answer from this question : Using gmail smtp via Laravel: Connection could not be established with host smtp.gmail.com [Connection timed out #110]
But it's the same. It does not work
Only 2 answers that I have not tried, ie the answers from 李偉成 and John Foley. I want to try both answers, but I am confused. Both answers explain to change ipv6 to ipv4
How do I change that and where I change it?
I need a detailed answer
My server using digital ocean, forge laravel and gitlab