I'm using smtp.gmail.com and port 587 to try and send mail from a web form using PHPMailer. I'm receiving the following error:
SMTP -> ERROR: Failed to connect to server: Connection timed out (110) The following From address failed: xxxxx@gmail.com ERROR.
What can I do to resolve this?
You need to connect to smtp.gmail.com on port 465, not port 587. Also, SSL is required. You should have the following in your form code:
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->SMTPSecure = "ssl";