Jump to content

Delivery Notification using the mail() function


bendurber

Recommended Posts

Hi,

 

I am using the mail function and want to add a delivery request so that I know the message was delivered.  This functionality is available in MS Outlook and seems to add the following into the message headers: 'Return-Receipt-To: "Name" <email>'.

 

If I replicate this in my php code it doesn't seem to do anything.

 

Any help would be much appreciated

 

Regards

 

Ben

Link to comment
Share on other sites

Thanks for the link revraz but unfortunately most email clients don't download the images when the message is opened.

 

cooldude832 what would that header be?  If you request a delivery receipt from Outlook you almost always get a notification dont you?

 

Thanks

 

Ben

Link to comment
Share on other sites

Most clients wont send back a receipt either.

 

Thanks for the link revraz but unfortunately most email clients don't download the images when the message is opened.

 

cooldude832 what would that header be?  If you request a delivery receipt from Outlook you almost always get a notification dont you?

 

Thanks

 

Ben

Link to comment
Share on other sites

I have been looking into this a little more and it seems that the delivery notification is bounced from the server and not client program.

 

For instance if I am not logged into my hotmail account and I then send it an email from outlook within a few seconds I get a delivery notification.

 

I cant figure out why requesting a receipt in the email header works for Outlook but not my server side script.

 

Thanks

 

Ben

 

Link to comment
Share on other sites

if you are mailing stuff like

<?php
$to = "me@stuff.com";
$subject= "Some email";
$body = "test Message";
$headers = "X-Type: 1.0";
if(mail($to,$subjet,$body,$header)){
echo "It worked";
}
else{
echo "It died.";
}
?>

if it gets throguh and echos "it worked" that means you simply didn't have a sytnaxical error in your php, but you could have an invalid header.  The receipeint mail box might report errors, I known my webmail does when I view the full headers.  You shoul be able to see the recievers errors and fix them

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.