I am facing a problem to send email using php mailer. I follow this article Click to see the steps
I just download this script and upload on my server (Hostgator). But it is not working..
It shows 406 not allowed error while sending
Here is my code in tracker.php file
require ('phpmailer/PHPMailerAutoload.php');
$from = "formget.dev@gmail.com"; //sender's username
$pwd = "formgetmb"; //sender's password
//-------------------------------------------------------SEND eMail----------------------------------------------------------------------
if (isset($_POST['mailto'])) {
try {
$mail = new PHPMailer(true); //New instance,exceptions enabled with true
$to = $_POST['mailto'];
$subject = $_POST['subject'];
$id = rand(111, 999);
$id.=rand(111, 999);
$body = "This is the fixed message of test email to get notify when it is read.....";
$body .= "<img border='0' src='http://www.zigsee.com/cvp/Booster/latestemailer/php-track-email/trackonline.php?email=$to&id=$id&subject=$subject' width='1' height='1' alt='image for email' >";
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->Username = $from; // SMTP server username
$mail->Password = $pwd; // SMTP server password
$mail->From = $from;
$mail->FromName = "TESTUSER";
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->AltBody = "Please return read receipt to me."; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
//return foll
echo '<input id="id1" name="id" type="hidden" value="' . $id . '">'
. '<input id="email1" name="email" type="hidden" value="' . $to . '">'
. '<label id="label1">Mail sent to <b>' . $to . '<b></label>';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
}