-2

i am using php mail function to send mail and i am using shared hosting of godaddy(a lot of domain there), the below code i am using.

$to ="mani.s@wikreatemedia.com";
$subject= "simple test";
$message ="my name is singh";
$headers = "From: myplace@wikreate.in\r\n";
$headers .= "Reply-To: myplace2@wikreate.in\r\n";
$headers .= "Return-Path: myplace@wikreate.in\r\n";
$headers .= "CC: sombodyelse@example.com\r\n";
$headers .= "BCC: hidden@example.com\r\n";
if ( mail($to,$subject,$message,$headers) ) {
   echo "The email has been sent!";
   } else {
  echo "The email has failed!";
 }

and here are the mail log

            Return-Path: <wicare@sg2plcpnl0153.prod.sin2.secureserver.net>
            Delivered-To: mani.s@wikreatemedia.com
            Received: from us2.mx.mailhostbox.com ([172.16.214.29])
            by mss17.mailhostbox.aus-tx.colo (Dovecot) with LMTP id tYCwNeK85FiHFQAAxGpCKA
            for <mani.s@wikreatemedia.com>; Wed, 05 Apr 2017 09:47:26 +0000
            Received-SPF: None (no SPF record) identity=mailfrom; client-  ip=182.50.132.200; helo=sg2nlsmtp01.shr.prod.sin2.secureserver.net; envelope-from=wicare@sg2plcpnl0153.prod.sin2.secureserver.net; receiver=mani.s@wikreatemedia.com 
            Received: from sg2nlsmtp01.shr.prod.sin2.secureserver.net (sg2nlsmtp01.shr.prod.sin2.secureserver.net [182.50.132.200])
            (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
            (No client certificate requested)
            by us2.mx.mailhostbox.com (Postfix) with ESMTPS id 0D75B300232
            for <mani.s@wikreatemedia.com>; Wed,  5 Apr 2017 09:47:25 +0000 (GMT)
            Received: from sg2plcpnl0153.prod.sin2.secureserver.net ([43.255.152.15])
            by : HOSTING RELAY : with SMTP
            id vhVRcTa5iweyCvhVRc2Bw8; Wed, 05 Apr 2017 02:45:37 -0700
            Received: from wicare by sg2plcpnl0153.prod.sin2.secureserver.net with local (Exim 4.87)
            (envelope-from <wicare@sg2plcpnl0153.prod.sin2.secureserver.net>)
            id 1cvhWB-00275t-P8; Wed, 05 Apr 2017 02:46:23 -0700
            To: abc@thepresidencyhotel.in
            Subject: Enquiry From Presidency api
            X-PHP-Script: wikreate.in/wikreate/presidencyapi/booknow.php for   122.177.57.204
            MIME-Version: 1.0
            Content-type:text/html;charset=iso-8859-1
            From: Nitish <tiwarypatna.96@gmail.com>
            Message-Id: <E1cvhWB-00275t-P8@sg2plcpnl0153.prod.sin2.secureserver.net>
            Date: Wed, 05 Apr 2017 02:46:23 -0700
            X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
            X-AntiAbuse: Primary Hostname - sg2plcpnl0153.prod.sin2.secureserver.net
            X-AntiAbuse: Original Domain - wikreatemedia.com
            X-AntiAbuse: Originator/Caller UID/GID - [2459384 215] / [47 12]
            X-AntiAbuse: Sender Address Domain - sg2plcpnl0153.prod.sin2.secureserver.net
            X-Get-Message-Sender-Via: sg2plcpnl0153.prod.sin2.secureserver.net: authenticated_id: wicare/only user confirmed/virtual account not confirmed
            X-Authenticated-Sender: sg2plcpnl0153.prod.sin2.secureserver.net: wicare
            X-Source: 
            X-Source-Args: /usr/sbin/proxyexec -q -d -s /var/lib/proxyexec/cagefs.sock/socket /bin/cagefs.server 
            X-Source-Dir: wikreate.in:/public_html/wikreate/presidencyapi
            X-CMAE-Envelope: MS4wfMRQ7kSJ8KWdx4itTHIjwisCrsBAakbBvt1OZ2yFPuFeOXdKUnda6IitvHoEaNxUwhgpYqEzzmJYzPeqRcrL6IAXSscpkCpv9Gu8WJX4hNsKaAMMCkaJ
            goZSEMn/6GyLYBpDNx8gW55kxrf4sWb/1P56wpu9eO8G3yeDF3wjkXoXAWN4zqemwDOA+x015Y/y3Er0sVdVYtpjdu5I6ikHheqMn4N2rWXFPkYo5fjaMFGH
            AqRWIbQ41vSoi6RORE/KkQ==
            X-Spam-Status: Yes
            X-CMAE-Score: 100
            X-CMAE-Analysis: v=2.2 cv=Id33YSia c=0 sm=1 tr=0
            p=vcK47+ICuhThKJHMN6jHbg==:17 a=ZoDhRiop4GmRtm87OYDT7A==:117

            <strong>You have received a new message</strong><br><br><strong>Name :</strong>  'Nitish'<br><br><strong>Email :</strong>  'tiwarypatna.96@gmail.com'<br><br><strong>Phone No :</strong>  '7503749637'<br><br><strong>Checkin date :</strong>  '04/05/17'<br><br><strong>Checkout date :</strong>  '04/06/17'<br><br><strong>Adults :</strong>  '1'<br><br><strong>Children :</strong>  '1'<br><br><strong>Room :</strong>  'Standard Room'<br><br><strong>Price :</strong>  '2133'<br><br><strong>Description :</strong>  'Our superior rooms reflect the ambience of a private urban residence with amenities of the finest five-star hotels. The superior rooms reflect the ambience of a private urban residence with amenities of the finest five-star hotels. We provide a superior room which is exquisitely furnished in an elegant, cosmopolitan, modern style. They are superior to deluxe Rooms and are one of the largest and the most luxurious accommodations in the hotel. The rooms include high ceilings addi
            ng to the roomy feel.

            Room features

            sq ft of contemporary space
            King/Twin bed
            Complimentary Breakfast
            High-speed Internet with LAN and Wi-Fi
            40-inch LED television with DVD player
            Parquet flooring
            City/Pool view
            Walk-in Closet
            Mini-bar, Writing Desk, Electronic Safe and Tea/Coffee Maker
            Twice-daily housekeeping service with complimentary packaged water
            Hair dryer
            Bathroom with Shower Cubical and luxurious amenities
            '

Kindly let me know where i doing wrong. I read too much article and implement it into my mail but there was no positive response, speak with support team of godady but the response was also negative from there although i have add spf txt record.

Mani Singh
  • 107
  • 1
  • 2
  • 14

2 Answers2

1

Short Answer

Use an smtp server like SendGrid, MailChimp, TotalSend, MailGun, SES etc through something like PHPMailer.

Long Answer

This is because mail by default does not use an SMTP server to send mails through, and instead uses the machine behind the sending domain as the authoritative server.

Over the past few years email spam filters have gotten a lot more strict around the sending of emails via Postfix/sendmail as the MTA (Mail Transfer Agent).

This has created a need for transactional mail services such as SendGrid, MailChimp, TotalSend, MailGun, SES etc.

The big difference that they provide is that their IP's aren't blocked and they make sure to maintain sending guidelines so as to avoid becoming part of spam networks.

AO_
  • 2,573
  • 3
  • 30
  • 31
  • This would be a solution if the OP wasn't on GoDaddy, which blocks all outbound SMTP. Sending services with HTTP APIs will work. – Synchro Apr 05 '17 at 10:14
  • Each of the above services provides API's so that you can use them or use the SMTP server accordingly. This answer still stands. – AO_ Apr 05 '17 at 10:36
0

The headers are not very informative, but it looks as if they don't like your content - your message is failing a spam check.

Validate your SPF settings at Scott Kitterman's site.

Sending from GoDaddy is a losing strategy too - many spam filters blacklist all of their IP ranges because they host so many spambots.

You're setting a return path header - don't do that, it's not the sender's job.

Generally you can't simply bypass spam filters, and they have no accountability. If you could, they wouldn't be spam filters.

Synchro
  • 35,538
  • 15
  • 81
  • 104