PHPMailer SMTP Connection Failed - GoDaddy
<p>I am working on a website, and in it there is a form that is used to send email through gmail with PHPMailer.</p>

<p>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).</p>

<p>I am getting this error: </p>

<blockquote>
  <p>Mailer Error: SMTP connect() failed.</p>
</blockquote>

<p>Here is my code:</p>

<pre><code>$mail = new PHPMailer;

$mail-&gt;SMTPDebug = 0;

$mail-&gt;isSMTP();
$mail-&gt;Host = "smtp.gmail.com";
$mail-&gt;SMTPAuth = true;
$mail-&gt;Username = "**********@gmail.com";
$mail-&gt;Password = "*************";
$mail-&gt;SMTPSecure = "tls";
$mail-&gt;Port = 587;

$mail-&gt;setFrom("**********@gmail.com", "Red's Mailer");
$mail-&gt;addAddress("*********@shaw.ca", "Name");

$mail-&gt;isHTML = true;

$mail-&gt;Subject = "New Submission From " . $name;
$mail-&gt;Body = $html_msg;
$mail-&gt;AltBody = $alt_msg;
</code></pre>

<p>Any ideas on the problem?</p>