NYCPHP Meetup

NYPHP.org

[nycphp-talk] PEAR Mail and pine "To:" peculiarity

John Daly jdaly at panix.com
Sat Oct 22 18:09:52 EDT 2005


Also, I tried it myself and found you can get the formatting you want by 
setting $recipients as follows, leaving out the $headers['To'] again.


$recipients = "John Daly <jdaly at panix.com>";
$headers['From']    = 'foo at bar.com';
//$headers['To']      = "John Daly <jdaly at panix.com>";

----- Original Message ----- 
From: "David Mintz" <dmintz at davidmintz.org>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Saturday, October 22, 2005 6:03 PM
Subject: Re: [nycphp-talk] PEAR Mail and pine "To:" peculiarity



Bingo.

Of course, the solution you suggest occurred to me as soon as I got into
the shower and adjusted the water temperature to my liking. You know:
step away from the machine, sir.

Thanks.

On Sat, 22 Oct 2005, John Daly wrote:

> David,
>
> It looks like you're already setting the To: header when you set 
> recipients
> and use it as the first argument to 'send'.  Leave out the $headers['To']
> and that should fix it.  I'm not familiar with this class, but there might
> be another association to set Name.
>
> JD
>
> ----- Original Message -----
> From: "David Mintz" <dmintz at davidmintz.org>
> To: <talk at lists.nyphp.org>
> Sent: Saturday, October 22, 2005 4:36 PM
> Subject: [nycphp-talk] PEAR Mail and pine "To:" peculiarity
>
>
>
> Anybody see anything wrong with this?
>
> <?php
> $mailer = Mail::factory('mail');
> $recipients = 'dmintz at davidmintz.org';
> $headers['From']    = 'vernon at vernontbludgeon.com';
> $headers['To']      = '"David Mintz" <dmintz at davidmintz.org>';
> $headers['Subject'] = 'Test message';
> $body = "This test used the 'mail' backend and a To field that says:
> $header[To]";
> true === $result = $mailer->send($recipients, $headers, $body)
> or exit($result->getMessage());
> echo "ok\n" ;
> ?>

---
David Mintz
http://davidmintz.org/
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org 




More information about the talk mailing list