NYCPHP Meetup

NYPHP.org

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

John Daly jdaly at panix.com
Sat Oct 22 16:49:43 EDT 2005


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" ;
?>

When this message reaches my inbox and I read it with the pine email
client, the To field says

To: dmintz at davidmintz.org, David Mintz <dmintz at davidmintz.org>

that is, listing my email address twice. Though I in fact get just one
copy of the message, it's ugly.

But when I send mail to myself through any other means I don't get this
behavior. And when I read this same message via my hosting service's web
interface, the To header displays thus


To:   "David Mintz" <dmintz at davidmintz.org>

which is what I want/expect.

Comments?

Thanks

---
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