0

I send email in PHP, and it's go to spam.

Here is the code:

$headers = 'From: noreply@nitrobit.net' . "\r\n" .
           'MIME-Version: 1.0' . "\r\n" .
           'Content-type: text/html; charset=utf-8' . "\r\n" .
           'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

Here is the Headers:

Delivered-To: superdown.me@gmail.com
Received: by 10.114.185.6 with SMTP id ey6csp45195ldc;
        Sun, 15 Sep 2013 04:01:53 -0700 (PDT)
X-Received: by 10.180.126.3 with SMTP id mu3mr9155535wib.27.1379242912725;
        Sun, 15 Sep 2013 04:01:52 -0700 (PDT)
Return-Path: <nitrobit@nitrobit.net>
Received: from ns3365488.ovh.net ([2001:41d0:a:2c2e::1])
        by mx.google.com with ESMTPS id n7si9138570wja.151.1969.12.31.16.00.00
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Sun, 15 Sep 2013 04:01:52 -0700 (PDT)
Received-SPF: softfail (google.com: domain of transitioning nitrobit@nitrobit.net does not designate 2001:41d0:a:2c2e::1 as permitted sender) client-ip=2001:41d0:a:2c2e::1;
Authentication-Results: mx.google.com;
       spf=softfail (google.com: domain of transitioning nitrobit@nitrobit.net does not designate 2001:41d0:a:2c2e::1 as permitted sender) smtp.mail=nitrobit@nitrobit.net
Received: from apache by ns3365488.ovh.net with local (Exim 4.76)
    (envelope-from <nitrobit@nitrobit.net>)
    id 1VLA5V-0002Ck-Po
    for superdown.me@gmail.com; Sun, 15 Sep 2013 13:01:57 +0200
To: superdown.me@gmail.com
Subject: NitroBit - סיסמה עבור קנייתך
X-PHP-Originating-Script: 0:ipn.php
From: NitroBit noreply@nitrobit.net
Reply-To: superdown.me@gmail.com
X-Mailer: PHP/5.3.27MIME-Version: 1.0
Content-type: text/html; charset=utf-8
Message-Id: <E1VLA5V-0002Ck-Po@ns3365488.ovh.net>
Date: Sun, 15 Sep 2013 13:01:57 +0200

What did I do wrong?

Thanks, and sorry for my English

HTMHell
  • 5,761
  • 5
  • 37
  • 79
  • Possible duplicate(s): [http://stackoverflow.com/search?q=email+go+to+spam](http://stackoverflow.com/search?q=email+go+to+spam) – Amal Murali Sep 16 '13 at 20:21
  • You should use 5th parameter of mail function – bksi Sep 16 '13 at 20:22
  • 1
    It is possible that it is going to your spam folder because the server this mail is being sent from is not set to being 'trusted'. This is not uncommon. Email sent from inside scripts like this has a tendency to being set a spam. – Justin Wood Sep 16 '13 at 20:22
  • 1
    Ummm... did you even bother to look at the headers of the mail you posted! Received-SPF: softfail (google.com: domain of transitioning nitrobit@nitrobit.net does not designate 2001:41d0:a:2c2e::1 as permitted sender) client-ip=2001:41d0:a:2c2e::1; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning nitrobit@nitrobit.net does not designate 2001:41d0:a:2c2e::1 as permitted sender) smtp.mail=nitrobit@nitrobit.net – gview Sep 16 '13 at 20:23

1 Answers1

2

It looks a little like this might be the issue:

softfail (google.com: domain of transitioning nitrobit@nitrobit.net does not designate 2001:41d0:a:2c2e::1 as permitted sender) client-ip=2001:41d0:a:2c2e::1;

You might want to see about getting your host (2001:41d0:a:2c2e::1) designated as a permitted sender on the domain @nitrobit.net

PaulProgrammer
  • 16,175
  • 4
  • 39
  • 56
  • You need to set/change the [SPF record](http://support.google.com/a/bin/answer.py?hl=en&answer=33786) in your domain's DNS system. – Arnold Daniels Sep 16 '13 at 20:28
  • @Mike B: That's very sanctimonious of you, but in this case, there is no mystery. The OP doesn't have SPF properly setup for his domain. – gview Sep 16 '13 at 20:29
  • @MikeB But this is the first time that it happens to me. Usually when I write a mail code it's not go to spam... – HTMHell Sep 16 '13 at 20:29
  • Avoiding spam filters is a constant battle. In part, it helps separate those who really care about not being spam from others, which helps reduce information overload for end users. You will probably be tweaking the mail headers and content constantly. – PaulProgrammer Sep 16 '13 at 20:33