[PHP] Mail Header/Return Receipt

2003-07-08 Thread Brian S. Drexler
Ok, I have an interesting one here.  I'm trying to send an e-mail from
Server A, through Server B, and to a recipient using PHP on Server A.
Server B relays the e-mail because Server A does not have an internet
connection.  Now, I want to request a read/delivery receipt for the user
sending the mail but if I specify the Disposition-Notification-To: Header
the mail fails to deliver because the username/domain that Server A is
executing the script with comes through.  I don't know if this makes any
sense but here is some stuff from the logs

This is from the server the mail is being sent to(Recipient Server)

Jul  8 13:32:13 www sendmail[26808]: h68HWCY26808: ruleset=check_mail,
arg1=[EMAIL PROTECTED], relay=ServerB.myDomain.com [64.113.42.5],
reject=501 5.1.8 [EMAIL PROTECTED]... Domain of sender address
[EMAIL PROTECTED] does not exist
Jul  8 13:32:13 www sendmail[26808]: h68HWCY26808:
from=[EMAIL PROTECTED], size=256213, class=0, nrcpts=0,
proto=ESMTP, daemon=MTA, relay=ServerB.myDomain.com [64.113.42.5]

This is from Server A:

Jul  8 12:43:48 ServerA sendmail[31361]: MAA31361: from=uucp, size=256011,
class=0, pri=286011, nrcpts=1,
msgid=[EMAIL PROTECTED], [EMAIL PROTECTED]
Jul  8 12:43:49 ServerA sendmail[31363]: MAA31361:
[EMAIL PROTECTED], ctladdr=uucp (10/14), delay=00:00:01,
xdelay=00:00:01, mailer=smtp, relay=ServerB.myDomain.com. [206.162.111.100],
stat=Sent (2.0.0 h68GhoQ18448 Message acc
epted for delivery)

This is from Server B:
Jul  8 12:43:56 ServerB sendmail[18450]: h68GhoQ18448:
to=[EMAIL PROTECTED], delay=00:00:06, xdelay=00:00:05,
mailer=esmtp, pri=286213, relay=mail.recipient.com. [64.113.39.156],
dsn=5.6.0, stat=Data format error
Jul  8 12:43:56 ServerB sendmail[18450]: h68GhoQ18448: h68GhuQ18450: DSN:
Data format error
Jul  8 12:43:57 ServerB sendmail[18450]: h68GhuQ18450:
to=[EMAIL PROTECTED], delay=00:00:01, xdelay=00:00:01,
mailer=esmtp, pri=286313, relay=ServerA.myDomain.com. [206.162.111.97],
dsn=2.0.0, stat=Sent (MAA31368 Message accepted for delivery)

Any help would be greatly appreciated.Thanks in advance!

Brian

Here is my code also: (I'm using PEAR Mail and MIME)

$FullName=$r[FullName];
$Email=$r[Email];
$ConfirmVia=$r[ConfirmVia];
$ConfirmTo=$r[ConfirmTo];
if($ConfirmVia==Email || $ConfirmVia==EMail) {
$file=/tmp/Quote.$Theresult..pdf;
system(ps2pdf $filename $file);
//This is the part that actually sends the mail
include('Mail.php');
include('Mail/mime.php');
$text = 'The quote that you requested is attached.  Thank you for the
opportunity to quote your enclosure needs!\n\n'.$FullName.'\n'.$Email;
$html = 'htmlbodyfont face=\Arial\The quote that you requested 
is
attached.  Thank you for the opportunity to quote your enclosure
needs!brbr'.$FullName.'br'.$Email.'/font/body/html';
$crlf = \r\n;
$hdrs = array(
'From'= $Email,
'Subject' = 'Your Quote # '.$Theresult,
'Disposition-Notification-To' = $Email,
'Return-Path' = $Email
);
$mime = new Mail_mime($crlf);

$mime-setTXTBody($text);
$mime-setHTMLBody($html);
//$mime-addAttachment($file, 'text/plain');
$mime-addAttachment($file);

$body = $mime-get();
$hdrs = $mime-headers($hdrs);

$mail = Mail::factory('mail');
$mail-send($ConfirmTo, $hdrs, $body);

//End mail part
system(rm -f $file);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Mail Header/Return Receipt

2003-07-08 Thread Ralph Guzman
Disposition-Notification-To: is not a sure bet, since the majority of
people ignore the return receipt.

The only way you will know if the email address is invalid is when the
email bounces back and the server sends you the error message. At this
point you can have a script check the email server spool file for
bounced messages containing invalid email addresses. 

If are running an in-house web server, one way you can check if the user
received the email, rather than attaching the pdf file to the email,
generate and keep the pdf file on your web server. Then on the email
give them a link to your web server where they can download the file.
But instead of linking straight to the pdf file, use a download script
that will check what file is being downloaded and then report this back
to you. Something like:

http://www.mydomain.com/download.php?file=Quote.pdf

If you must attach the file to the email, then another method would be
to include an IMG tag in the email message, so when the recipient
opens up the email IMG will call out a script on your server which
will track the users email address and then report this back to you.
Something like:

IMG
SRC=http://www.mydomain.com/[EMAIL PROTECTED]
WIDTH=1 HEIGHT=1 BORDER=0

 
-Original Message-
From: Brian S. Drexler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 11:19 AM
To: 'Ralph Guzman'
Subject: RE: [PHP] Mail Header/Return Receipt

That is a good idea.  I can tell them it has at least been sent from our
server, but what if the e-mail address they are sending it to is not
valid?
I'd like for them to know if it fails.  I'll figure it out.  When I do
I'll
let you know what I did.  Thanks for all the help and suggestions!

Brian

-Original Message-
From: Ralph Guzman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 2:12 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mail Header/Return Receipt


once the email is sent out, can't you simply have your script send the
user a receipt?

If you must use Disposition-Notification-To: for the receipt then I
think you will have to figure how to do this on the email server level.
Afterall, the script is doing what it's supposed to.

-Original Message-
From: Brian S. Drexler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 10:47 AM
To: 'Ralph Guzman'
Subject: RE: [PHP] Mail Header/Return Receipt

I can't.  Server A has a printer driver installed that calls some PHP
functions.  It takes the title tag from a Postscript file sent to the
printer and gets some information from a different machine running MySQL
on our network.  Depending on this information it may fax the postscript
file using HylaFAX or e-mail it.  If it is going to e-mail then it then
takes that information (e-mail address, to and from, phone number, etc.)
and creates an HTML e-mail and a PDF file and e-mail's them.  It works
pretty well for us and it makes it simple for the people using the
application. All they do is print the report to a default printer and it
does all the work for them.  With the faxes it will e-mail them a
confirmation if it fails or not, and that's what I'm trying to get the
e-mail to do (quite unsuccessfully I might add).  Good thought though.
Any other ideas?

-Original Message-
From: Ralph Guzman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 1:41 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mail Header/Return Receipt


What if you run the script from server b?

-Original Message-
From: Brian S. Drexler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 10:33 AM
To: 'Ralph Guzman'
Subject: RE: [PHP] Mail Header/Return Receipt

Ok, I wasn't sure if it was a simple header tag that I was missing or
something like that.  Thanks though...




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php