Php Mailer error - Godaddy Smtp
<p>I have a project in which I have to send 100-200 mails to users but every mail has different token for each user. I have the email hosted on godaddy.</p>

<p>So I was looking to send email using phpmailer. Below is the script which I am testing but it keeps giving me this error - </p>

<p>SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed. <a href="https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" rel="nofollow">https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting</a>
Mailer Error: SMTP connect() failed. <a href="https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" rel="nofollow">https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting</a></p>

<pre><code>&lt;?php

//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');

require 'mailm/PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail-&gt;isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail-&gt;SMTPDebug   = 2;
$mail-&gt;DKIM_domain = '127.0.0.1';
//Ask for HTML-friendly debug output
$mail-&gt;Debugoutput = 'html';
//Set the hostname of the mail server
$mail-&gt;Host        = "smtpout.secureserver.net";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail-&gt;Port        = 465;
//Whether to use SMTP authentication
$mail-&gt;SMTPAuth    = true;
//Username to use for SMTP authentication
$mail-&gt;Username    = "itsupport@mysite.ae";
//Password to use for SMTP authentication
$mail-&gt;Password    = "Mypassword";
$mail-&gt;SMTPSecure  = 'ssl';
//Set who the message is to be sent from
$mail-&gt;setFrom('itsupport@mysite.ae', 'IT Helpdesk');
//Set an alternative reply-to address
//$mail-&gt;addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail-&gt;addAddress('sgajara@gmail.com', 'IT Helpdesk');
//Set the subject line
$mail-&gt;Subject = 'PHPMailer SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
//Replace the plain text body with one created manually
$mail-&gt;Body = 'This is a plain-text message body';
//Attach an image file


//send the message, check for errors
if (!$mail-&gt;send()) {
    echo "Mailer Error: " . $mail-&gt;ErrorInfo;
} else {
    echo "Message sent!";
}
?&gt;
</code></pre>

<p>This script I have found on a blog. </p>

<p>Any alternatives to this are also welcomed, My purpose is to send 200 emails from my godaddy email account but every email has a separate token which is fetched from the database and then inserted in the mail body and sent to the user.</p>