2017-04-05 389 views
-2

我使用PHP邮件功能发送邮件,我使用共享主办的godaddy(很多域有),下面的代码我正在使用。邮件转到垃圾邮件框中的PHP邮件功能

$to ="[email protected]"; 
$subject= "simple test"; 
$message ="my name is singh"; 
$headers = "From: [email protected]\r\n"; 
$headers .= "Reply-To: [email protected]\r\n"; 
$headers .= "Return-Path: [email protected]\r\n"; 
$headers .= "CC: [email protected]\r\n"; 
$headers .= "BCC: [email protected]\r\n"; 
if (mail($to,$subject,$message,$headers)) { 
    echo "The email has been sent!"; 
    } else { 
    echo "The email has failed!"; 
} 

和这里的邮件日志

  Return-Path: <[email protected]> 
      Delivered-To: [email protected] 
      Received: from us2.mx.mailhostbox.com ([172.16.214.29]) 
      by mss17.mailhostbox.aus-tx.colo (Dovecot) with LMTP id tYCwNeK85FiHFQAAxGpCKA 
      for <[email protected]>; 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; [email protected]; [email protected] 
      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 <[email protected]>; 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 <[email protected]>) 
      id 1cvhWB-00275t-P8; Wed, 05 Apr 2017 02:46:23 -0700 
      To: [email protected] 
      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 <[email protected]> 
      Message-Id: <[email protected]> 
      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> '[email protected]'<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 
      ' 

请让我知道我做错了。我读了太多的文章,并将其实施到我的邮件,但没有积极的回应,与godady的支持团队发言,但答复也从那里消极,虽然我已添加spf txt记录。

+0

您正在使用哪个SMTP? –

+0

@disha singh:没有smtp我正在发送邮件,它的工作,但邮件总是发送垃圾邮件 –

+0

这不是你在PHP发送的邮件。 –

回答

1

简答

使用SMTP服务器一样SendGrid,MailChimp,TotalSend,MailGun,SES等通过类似PHPMailer的。

长的答案

这是因为mail在默认情况下不使用SMTP服务器通过发送邮件,而是使用机器发送域的权威服务器后面。

在过去几年中,电子邮件垃圾邮件过滤器在通过Postfix/sendmail作为MTA(邮件传输代理)发送电子邮件方面变得更为严格。

这创造了必要的交易邮件服务,如SendGrid,MailChimp,TotalSend,MailGun,SES等

很大的区别,他们提供的是,他们的IP的不被堵塞,他们一定要保持发送指导方针以避免成为垃圾邮件网络的一部分。

+0

如果OP不在GoDaddy上,这将是一个解决方案,它阻止所有出站SMTP。使用HTTP API发送服务将会起作用。 – Synchro

+0

上述每项服务均提供API,以便您可以使用它们或相应地使用SMTP服务器。这个答案仍然存在。 –

0

标题不是很丰富,但看起来好像他们不喜欢你的内容 - 你的消息没有通过垃圾邮件检查。

验证您的SPF设置为Scott Kitterman's site

从GoDaddy发送邮件也是一个失败的策略 - 许多垃圾邮件过滤器会将所有IP地址范围列入黑名单,因为他们托管了太多垃圾邮件。

您正在设置返回路径标题 - 不这样做,这不是发件人的工作。

通常你不能简单地绕过垃圾邮件过滤器,他们没有问责制。如果可以的话,他们不会是垃圾邮件过滤器。