I just subscribed to the godaddy server to test the PHP script that I am writing. I use PHPMailer to send email, it uses godaddy Host email address: relay-hosting.secureserver.net
The problem is that I would like to mark this email as "me" @ gmail.com
When I sent emails using my gmail address in the AddReplyTo field, the recipient's email account sends it directly to the junk folder.
I know that there is a fundamental problem: I am sending conflicting headers, and probably this somehow gets into the spam folder.
Can someone please explain to me how I can solve this. Thank.
the code:
try {
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->CharSet = 'utf-8';
$mail->SMTPDebug = 2;
$mail->SMTPAuth = false;
$mail->Host = "relay-hosting.secureserver.net";
$mail->AddReplyTo('me@gmail.com', 'Me');
$mail->AddAddress('them@hotmail.co.uk', 'Them');
$mail->SetFrom('me@gmail.com', 'Me');
$mail->Subject = 'PHPMailer Test Subject via smtp, basic with authentication';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
$mail->MsgHTML("Hi, this is an test email");
$mail->Send();
} catch (phpmailerException $e) {
echo $e->errorMessage();
} catch (Exception $e) {
echo $e->getMessage();
}