Some of the times trying to send email through php web application I'm getting "smtp connection failed", and some other times it works perfectly without throwing any exceptions. The app is under the same configuration as always ( "smtp.gmail.com", port: 587, protocol: TLS ). I beleive that the error it's triggered by a timeout as the gmail server does not response. I've noticed this irregular behaviour since last week or so. Any clues?
This is the response with "SMTPDebug = 3" enabled:
2017-02-02 16:19:36 Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ) 2017-02-02 16:20:18 SMTP ERROR: Failed to connect to server: Network is unreachable (101) 2017-02-02 16:20:18 Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ) 2017-02-02 16:21:02 SMTP ERROR: Failed to connect to server: Network is unreachable (101)
I've also tried adding "tls://" to the host address smtp.gmail.com, as suggested in other tread with no success...
thanks in advance