PHPMailer on godaddy server, configure correctly?

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(); // Using SMTP.
    $mail->CharSet = 'utf-8';
    $mail->SMTPDebug = 2; // Enables SMTP debug information - SHOULD NOT be active on production servers!
    $mail->SMTPAuth = false; // Enables SMTP authentication.
    $mail->Host = "relay-hosting.secureserver.net"; // SMTP server host.

    $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(); 
}
+5
2

. , , me@myhostedexampledomain.com. Google , . Go Daddy relay-hosting.secureserver.net .

+8

:

$mail- > Host = "localhost";// SMTP-.

GoDaddy "localhost" PHPMailer.

+3

All Articles