[nycphp-talk] Emails not being received when using mail()
Jake McGraw
jmcgraw1 at gmail.com
Tue Jan 15 09:43:53 EST 2008
Not to get off the topic of debugging your particular problem, but
I've always used SwiftMailer (http://www.swiftmailer.org/), which is
all OO and has many tips on correct usage.
- jake
On Jan 14, 2008 11:15 PM, B.A.S. <lists at nopersonal.info> wrote:
> Hans Kaspersetz wrote:
> >> // build additional headers
> >> $additionalHeaders = "From: me at example.com\r\n";
> >> $additionalHeaders .= "To: recipient2 at example.com\r\n";
> >> $additionalHeaders .= "Cc: recipient3 at example.com\r\n";
> >> $additionalHeaders .= "Return-Path: -f me at example.com\r\n";
> >> $additionalHeaders .= "Reply-To: me at example.com\r\n";
> >>
> >>
> > Well, as I suspected you definitely have some problems in your header
> > and the address the mail is coming from doesn't exist in the real
> > world. The first thing to correct is the line: $additionalHeaders .=
> > "Return-Path: -f me at example.com\r\n"; It is non-sense drop it all
> > together.
>
> Done.
>
> > Then make your mail() call something like this: $mailSent = mail($to,
> > $subject, $message, $additionalHeaders, "-f me at example.com"). It is a
> > little late any my eyes are dry, but that should go a long way to fixing
> > you up. However, this will only work if your host allows you to
> > override with the -f flag. Make the changes and send us the new headers.
>
> Done. All emails bounced with the following msg:
>
> A message that you sent could not be delivered to one or more of its
> recipients. This is a permanent error. The following address(es) failed:
>
> recipient1 at example.com
> Mail sent by user nobody being discarded due to sender restrictions
> in WHM->Tweak Settings
> recipient2 at example.com
> Mail sent by user nobody being discarded due to sender restrictions
> in WHM->Tweak Settings
> recipient3 at example.com
> Mail sent by user nobody being discarded due to sender restrictions
> in WHM->Tweak Settings
>
> New headers from bounce msg:
>
> Return-path: <>
> Envelope-to: me at example.com
> Delivery-date: Mon, 14 Jan 2008 21:54:45 -0600
> Received: from mailnull by mercury.hostspectrum.com with local (Exim 4.68)
> id 1JEcsv-0000He-LN
> for me at example.com; Mon, 14 Jan 2008 21:54:45 -0600
> X-Failed-Recipients: recipient1 at example.com,
> recipient2 at example.com,
> recipient3 at example.com
> Auto-Submitted: auto-replied
> From: Mail Delivery System <Mailer-Daemon at mercury.hostspectrum.com>
> To: me at example.com
> Subject: Mail delivery failed: returning message to sender
> Message-Id: <E1JEcsv-0000He-LN at mercury.hostspectrum.com>
> Date: Mon, 14 Jan 2008 21:54:45 -0600
>
> > In any event, you mail is not being routed by Google and the like
> > because your Return-Path is not being set to an address that exists in
> > the real world.
>
> Duly noted; thanks.
>
> Regards,
> Bev
>
>
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
More information about the talk
mailing list