Page 1 of 1

confirm mail send using php

Posted: Wed Mar 04, 2009 5:46 am
by srdva59
hi,
there is any way to confirm is the mail was sent and received and read by using
a php script?
when we send by the outlook we have that option but i want
add that function to my script that is possible in php?
thanks for your help
:)

Re: confirm mail send using php

Posted: Wed Mar 04, 2009 11:08 pm
by JAB Creations
You send mail by doing the following...

Code: Select all

<?php
mail('caffeinated@example.com', 'My Subject', $message);
?>
...so just assigned that to a variable and check for true or false...

Code: Select all

<?php
$result = mail('caffeinated@example.com', 'My Subject', $message);
 
if (!result) {echo '<div><p>Mail was not able to be sent!</p></div>';}
else {echo '<div><p>Mail was sent!</p></div>';}
?>

Re: confirm mail send using php

Posted: Wed Mar 04, 2009 11:14 pm
by watson516
That will only check to see if the message was sent successfully, not if it was read by the user. If its html email, you could use an image from your site with some get variables to see when the users reads the email. Im not sure if this is the 'proper' way of doing things but Im sure it would work. There could be other ways.

Re: confirm mail send using php

Posted: Wed Mar 04, 2009 11:24 pm
by JAB Creations
I think there is some sort of request receipt feature I've encountered before...I'm not sure how widely it's supported though. That's the only lead I'd have as far as seeing if email was checked on a different domain.

Re: confirm mail send using php

Posted: Thu Mar 05, 2009 3:16 am
by srdva59
nice thanks for you help :)