1

i am facing a problem of delivering email to hotmail inbox. my email is marked as spam and it is delivered to hotmail spam folder.

My Code

<?php
    $header = "Reply-To: info <info@appleparking.co.uk>\r\n";
    $header .= "Return-Path: info <info@appleparking.co.uk>\r\n";
    $header .= "From: info <info@appleparking.co.uk>\r\n";
    $header .= "Organization: Mobit Solutions\r\n";
    $header .= "Content-Type: text/plain\r\n";

    if(mail("my_personal_email@hotmail.com", "Test Message", "testing",$header))
        echo "email sent";
    else
        echo "email not sent";

?>

any help would be appreciated.

UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
  • 3
    You should probably check the headers to see why it is marked as spam. – Nanne Mar 30 '12 at 11:27
  • how to check it? kindly guide me. – UMAR-MOBITSOLUTIONS Mar 30 '12 at 11:29
  • Did you try to google how to check headers? If you really can't figure it out I suppose you can open en second question about that, but I suppose checking email headers is not really a programming question? Anyway, you might try http://email.about.com/od/windowslivehotmailtips/qt/How_to_See_Full_Email_Headers_in_Windows_Live_Hotmail.htm and http://www.emailaddressmanager.com/tips/header.html – Nanne Mar 30 '12 at 11:47
  • I had similar problems. Had to set up SPF, and remove the reply-to header, which was different form my sender email address – Carl D'Halluin May 10 '12 at 09:43

3 Answers3

1

There is not much you can do from your PHP code. However your code seems to be ok.

Double check your SPF records in DNS. You can read more about SPF records here.

Also consider using Domain Keys

Alex Amiryan
  • 1,374
  • 1
  • 18
  • 30
0

I'd use SwiftMailer or PHPMailer and nothing fancy (such as templates) to make sure emails are correctly delivered.

Ronan
  • 1,482
  • 11
  • 11
0

your script working fine for me, here are the results; enter image description here Some times web Host make problems like these, i suggest you to contact your web service provider for this issue. Best of Luck!

m-t
  • 502
  • 5
  • 11