getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

Cannot send mail with gmail smtp (timeout) #62

Closed Xarkam closed 6 years ago

Xarkam commented 6 years ago

Hello, I try to send mail with contact form but I receive always a timeout:

xarkam@intranet:/var/www/grav$ sudo bin/plugin email test-email -t xarkam@gmail.com 

Current Configuration:

array:8 [
  "enabled" => true
  "from" => "xarkam@gmail.com"
  "from_name" => null
  "to" => "xarkam@gmail.com"
  "to_name" => null
  "mailer" => array:3 [
    "engine" => "smtp"
    "smtp" => array:5 [
      "server" => "smtp.gmail.com"
      "port" => 465
      "encryption" => "ssl"
      "user" => "xarkam@gmail.com"
      "password" => "**************"
    ]
    "sendmail" => array:1 [
      "bin" => "/usr/sbin/sendmail"
    ]
  ]
  "content_type" => "text/html"
  "debug" => true
]

[Swift_TransportException]                                                                             
  Connection could not be established with host smtp.gmail.com [Connection timed out #110]               
  Log data:                                                                                              
  ++ Starting Swift_SmtpTransport                                                                        
  !! Connection could not be established with host smtp.gmail.com [Connection timed out #110] (code: 0)

Can you help me ?

Email plugin 2.6.2 Contact form 2.9.2

Xarkam commented 6 years ago

I found the solution :)

rhukster commented 6 years ago

What was it? The answer could help others :)

Xarkam commented 6 years ago

It's just a bad configuration.

You must use port 587 and tls for gmail.

matepaiva commented 5 years ago

That helped me too, Xarkam. Thanks for sharing. This happened in a shared host.

rhukster commented 5 years ago

Thanks updated the readme.