I am working on a website, and in it there is a form that is used to send email through gmail with PHPMailer.
I have it all set up correctly, because it works on my AWS EC2 server. However, when I use the exact same setup on a GoDaddy hosting plan, it doesn't work (yes, I changed 'require' paths).
I am getting this error:
Mailer Error: SMTP connect() failed.
Here is my code:
$mail = new PHPMailer;
$mail->SMTPDebug = 0;
$mail->isSMTP();
$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Username = "**********@gmail.com";
$mail->Password = "*************";
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->setFrom("**********@gmail.com", "Red's Mailer");
$mail->addAddress("*********@shaw.ca", "Name");
$mail->isHTML = true;
$mail->Subject = "New Submission From " . $name;
$mail->Body = $html_msg;
$mail->AltBody = $alt_msg;
Any ideas on the problem?