#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Automated email not being delivered


    Hi, I hope this is the right forum for this - apologies if not. I'm something of a newbie and this problem is driving me mad. I've searched Google and the forums and done everything I have come across but it still won't work. I'd appreciate any help in getting this to work.

    I have a website where people register and receive a confirmation email. In about 20% of cases the email is not being delivered. The email is sent in plain text and HTML via SMTP using PEAR:Mail on shared hosting. SPF is configured.

    The code is:

    Code:
    function send_mail( $to, $subject, $text, $html="" )
    {
    	$crlf = "\r\n";
    	$hdrs = array(
    	'From'    => "aaa<auto@xxx.com>",
    		'Return-Path' => 'auto@xxx.com',
    	    'Subject' => $subject
    	);
    	
    	$mime = new Mail_mime($crlf);
    	$mime->setTXTBody($text);
    	if( !empty($html) )
    	{
    		$mime->setHTMLBody($html);
    	} 
    	$body = $mime->get();
    	$hdrs = $mime->headers($hdrs);
    	$mail =& Mail::factory("smtp");
    	$mail->send($to, $hdrs, $body);
    }
    This is the message with header when sent successfully (to me in this case):

    Code:
    Return-path: <auto@xxx.com>
    Envelope-to: test@yyy.co.uk
    Delivery-date: Mon, 23 Aug 2010 16:49:09 +0100
    Received: from [212.159.7.102] (helo=mx.pcl-ipin03.plus.net)
    	  by inmx20.plus.net with esmtp (PlusNet MXCore v2.00) id 1OnZFy-0007IH-K6 
    	  for test@yyy.co.uk; Mon, 23 Aug 2010 16:48:18 +0100
    Received-SPF: None identity=pra; client-ip=69.175.127.186;
      receiver=mx.pcl-ipin03.plus.net;
      envelope-from="auto@xxx.com";
      x-sender="auto@xxx.com";
      x-conformance=sidf_compatible
    Received-SPF: Pass identity=mailfrom; client-ip=69.175.127.186;
      receiver=mx.pcl-ipin03.plus.net;
      envelope-from="auto@xxx.com";
      x-sender="auto@xxx.com";
      x-conformance=sidf_compatible
    Received-SPF: None identity=helo; client-ip=69.175.127.186;
      receiver=mx.pcl-ipin03.plus.net;
      envelope-from="auto@xxx.com";
      x-sender="postmaster@cl91.justhost.com";
      x-conformance=sidf_compatible
    X-SBRS: 0.6
    X-IronPort-Anti-Spam-Filtered: true
    X-IronPort-Anti-Spam-Result: AqQaAA81ckxFr3+6amdsb2JhbACFGppCAgFQFRQEIiKHV0wBpC0+jlqDBAgFgio
    X-IronPort-AV: E=McAfee;i="5300,2777,6082"; a="385284071"
    X-IronPort-AV: E=Sophos;i="4.56,258,1280703600"; 
       d="scan'208,217";a="385284071"
    Received: from cl91.justhost.com ([69.175.127.186])
      by mx.pcl-ipin03.plus.net with ESMTP; 23 Aug 2010 16:48:17 +0100
    DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=xxx.com;
    	h=Received:MIME-Version:Content-Type:From:Subject:X-ACL-Warn:X-Source:X-Source-Args:X-Source-Dir;
    	b=R7cecFeuhzANTdPRQir9DdyZtICO3ZRNFox5760FcyUdni8LqW7SNuPBof1Boi5F3YCgY9UiRVbc4c7eU1PdMJwaJOlhN0RsrvGcsx6KVA0+7rHB3Gu+i4ol7GhJwQIF;
    Received: from localhost.localdomain ([127.0.0.1] helo=localhost)
    	by cl91.justhost.com with esmtp (Exim 4.69)
    	(envelope-from <auto@xxx.com>)
    	id 1OnZFv-00063J-9f
    	for test@yyy.co.uk; Mon, 23 Aug 2010 10:48:15 -0500
    MIME-Version: 1.0
    Content-Type: multipart/alternative;
     boundary="=_2595ffdad1f464290babf36b7275e515"
    From: My Site<auto@xxx.com>
    X-ACL-Warn: {
    X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
    X-AntiAbuse: Primary Hostname - cl91.justhost.com
    X-AntiAbuse: Original Domain - yyy.co.uk
    X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
    X-AntiAbuse: Sender Address Domain - xxx.com
    X-Source: 
    X-Source-Args: 
    X-Source-Dir: 
    Message-ID: <E1OnZFy-0007IH-K6@inmx20.plus.net>
    To:
    X-PN-Spam-Filtered: by PlusNet MXCore (v5.00)
    Subject: Account activation
    
    --=_2595ffdad1f464290babf36b7275e515
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
     charset=ISO-8859-1
    
    
    Thank you for registering ...
    
    --=_2595ffdad1f464290babf36b7275e515
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/html;
     charset=ISO-8859-1
    
    
    <html>
    	<head>
    		<style>
    			body { line-height: 1.5; }
    			li { list-style-type: none; }
    		</style>
    	</head>
    	<body>
    		<p>
    			Thank you for registering ...
    		</p>
    		<p>
    	</body>
    
    </html>
    --=_2595ffdad1f464290babf36b7275e515--
    I guess it's getting rejected as spam. Can anyone suggest what's wrong?

    Thanks.

    Bob
  2. #2
  3. They're coming to take me away

    Join Date
    Jan 2005
    Location
    Florida
    Posts
    5,105
    Rep Power
    5049
    1) Does it always get rejected from the same domains, or is it random? In other words, do some gmail, yahoo, and hotmail users receive them, but others don't, or do all just get rejected?

    2) Are they being received in Junk / Spam folders, or just lost in space somewhere? (Or are they returned)

    Seems as though the headers are fine in the sense that they are delivering as a particular domain and not an IP address (which is a big cause for emails being rejected or not delivered).
    "I don't need to get a life. I'm a gamer. I have lots of lives!"
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0
    I can't see any pattern in the domains being rejected. googlemail.com has been rejected a couple of times as has hotmail.com but there are a number of other domains that have been rejected as well.

    I've asked a couple of people to check their spam / junk and they reported nothing found. I also added a note to the registration page asking people to check their spam folders.

    If I send the same email from my normal mail client using the same from address, etc it arrives OK.

    Bob
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0
    If I send the email from my mail client the header contains DomainKeys and User-Agent. Otherwise it is identical to the header for the automatically generated email.

    Would lack of DomainKeys cause some MTAs to reject the email?

    Bob
  8. #5
  9. They're coming to take me away

    Join Date
    Jan 2005
    Location
    Florida
    Posts
    5,105
    Rep Power
    5049
    Originally Posted by Bob TB
    Would lack of DomainKeys cause some MTAs to reject the email?
    Not to the extent you're describing. I have many PHP mailer scripts that send out mail and haven't had many issues at all. May be an issue with your PEAR script.

    I'll move this over to the PHP forum (and leave a redirect link here).
    "I don't need to get a life. I'm a gamer. I have lots of lives!"
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    If I send the same email from my normal mail client using the same from address, etc it arrives OK.
    Does your normal mail client use the same SMTP server as your PHP script?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0
    Originally Posted by E-Oreo
    Does your normal mail client use the same SMTP server as your PHP script?
    Yes. I set up an account to mimic the PHP script as closely as possible.

    However, I am not logging in to the SMTP server in the script, just using the default settings. This means that the message is received from localhost.localdomain in the script and from bobhawkes.plus.com (my ISP) with the mail client. Would localhost cause an issue? Should I LOGIN in Mail::factory("smtp").

    Bob
  14. #8
  15. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    Authenticating wouldn't change where the E-Mail is received from, but it's worth trying. Basically all you can do is try changing different things until you fix some of the problematic accounts. Unless you have an extremely small user base you'll never be able to deliver to 100% of users though.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    3
    Rep Power
    0
    Originally Posted by Bob TB
    I can't see any pattern in the domains being rejected. googlemail.com has been rejected a couple of times as has hotmail.com but there are a number of other domains that have been rejected as well.

    I've asked a couple of people to check their spam / junk and they reported nothing found. I also added a note to the registration page asking people to check their spam folders.

    If I send the same email from my normal mail client using the same from address, etc it arrives OK.

    Bob
    I experience this too. Really inconvenient.

IMN logo majestic logo threadwatch logo seochat tools logo