[nycphp-talk] bounced email and Mail::send()
Allen Shaw
ashaw at polymerdb.org
Fri Oct 14 15:47:59 EDT 2005
Hi All,
I would expect mail sent to bad addresses to bounce, but maybe I'm
missing something. The following code snippet does send mail to good
addresses, but mail to bad addresses don't seem to bounce back to me. I
suppose I'm missing some header, but I don't know what it would be. Any
ideas?
<?php
include_once('Mail.php');
include_once('Mail/mime.php');
$hdrs = array(
'From' => 'me at mydomain.com',
'Subject' => 'email subject',
'Return-Path' => 'me at mydomain.com',
'Reply-To' => 'me at mydomain.com',
'Return-Receipt-To' => 'me at mydomain.com'
);
$mime = new Mail_mime("\n");
$mime->setTXTBody("sample text");
$mime->addAttachment('/tmp/sample.pdf', 'application/pdf');
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send('nonExistentUser at mydomain.com', $hdrs, $body);
?>
BTW, I checked, and the mail is not falling into a failover or other
black hole that I know of. For example sending to
"nonExistentUser at mydomain.com" from my desktop mail client gets me a
bounce within a few minutes. Any thoughts?
- Allen
--
Allen Shaw
Polymer (http://polymerdb.org)
More information about the talk
mailing list