0

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

moses toh
  • 12,344
  • 71
  • 243
  • 443
  • Can you maybe post your SMTP configs? What's the console output when you try to connect to the smtp server via telnet? There's just not enough information to help right now. – Oliver Feb 14 '18 at 15:31
  • @Oliver, Where I can find my SMTP config? How can I connect to the smtp server via telnet? I need a detail answer – moses toh Feb 14 '18 at 23:22
  • You must have configured your smtp access somewhere, right? Username? Password? If you haven't then that's a problem. Gmail doesn't let you use their smtp servers without configuring access credentials properly. – Oliver Feb 15 '18 at 01:17
  • @Oliver I try in my localhost, it works. No error. This error only occurs on the staging server. So I had configured it. Because in my localhost, the send mail works – moses toh Feb 15 '18 at 02:37

0 Answers0