[nycphp-talk] bounced email and Mail::send()
Allen Shaw
ashaw at polymerdb.org
Mon Oct 17 14:11:51 EDT 2005
Now *this* works. I didn't realize that the Mail::factory() docs
mentioned a $backend argument, and even those docs wouldn't have lead me
to believe I'd get better results by changing it, but just switching to
'smtp' instead of 'mail' seems to have solved the problem entirely.
Good call.
Thanks,
Allen
Kenneth Downs wrote:
> I went nuts with this until I gave up on shell emails and used TCP. The
> TCP option requires you to have your email server running, but on the
> other hand, the shell method made it impossible to get the Return path
> right, and that was a deal-breaker. Using the PEAR package the code is
> this:
>
> // Assume an array $em() that has some stuff in it
> include_once('Mail.php');
> $recipients =$em["email_to"];
> $headers['From'] = $from_name. "<".$from_addr.">";
> $headers['To'] = $em["email_to"];
> $headers['Subject'] = $em["email_subject"];
> $headers['Date'] = date("D, j M Y H:i:s O",time());
> $body = $em["email_message"];
> $mail_object = Mail::factory('smtp', $params);
> $mail_object->send($recipients, $headers, $body);
>
> Once I got this running I've never looked back.
>
>
>>Thanks, Anirudh. I'll look into this some more. To pass the -f flag to
>>the PHP mail() function might work, but also I am trying to do this with
>>PEAR Mail::send(), so I will dig deeper into that codebase to look for
>>clues.
>>
>>Still mystified,
>>Allen
--
Allen Shaw
Polymer (http://polymerdb.org)
More information about the talk
mailing list