Php: Check Who Had Read Sent Email

PHP: Check who had read sent email?

Add Header to email:

Disposition-Notification-To: you@yourdomain.com

As mentioned above it's not reliable and it's better to do something like this:

<img src="http://yourdomain.com/emailreceipt.php?receipt=<email of receiver>" />

And log it in a database, although again this is restricted by the email client's ability to show images and sometimes it may even put the mail into junk because it doesn't detect an image... a workaround that would be to actually outputting an image (say your logo) at the end of that script.

Edit:
A quick lookup at the phpmailer class gave me the following:

$mail->ConfirmReadingTo = 'yourown@emailaddress.com';

but it's the same as the Disposition-Notification-To method above.

How can i know if someone has opened an email?

The only way I know of - and it's not very reliable - is to send an HTML mail in which you include something like:

PHP Code:

<img src='http://www.domain.com/mailcheck.php?user=123'>

image but in the process, you can track the GET user. You can also find a way to modifier the mail header so as to request a receipt - but I don't know how to do that - and it's also not reliable because of the voluntary nature of the request.

To check whether an email sent by me is read or not

The most common means of accomplishing this is to send HTML email, with references to some image hosted by your web server. In each email, as part of that image's URL, include a unique identifier. Then as people read your email, and download the images, that activity will be noted in your web server logs. All you have to do then is a bit of log analysis.

PHP + PHPMailer - check if email was opened / read

You are missing a closing paren on this line

if (($_GET['Type'] == 'Poststay') && (!empty($_GET['crs'])) {`

This should probably be:

if(isset($_GET['Type']) && $_GET['Type'] == 'Poststay') {

This verifies that the paramerter is set in the request, and if it equals Poststay, then will execute your other stuff.

PHP code to Read Sent Items from an Email Account

Got it working and successfully retrieved all sent emails by replacing {mail.domain.com:143/notls} with {mail.domain.com:143/notls}INBOX.Sent.

That is by setting the value of $current_mailbox['mailbox'] to {mail.remanns.com:143/notls}INBOX.Sent

The complete code is

$mailboxes = array(
array(
'label' => 'domain.com',
'enable' => true,
'mailbox' => '{mail.domain.com:143/notls}INBOX.Sent',
'username' => 'mail@domain.com',
'password' => 'mypassword'
)
);

$stream = @imap_open($current_mailbox['mailbox'], $current_mailbox['username'], $current_mailbox['password']);

Thank you Darren for guiding me through the right path. I figured it out by following you suggestion regarding finding the sent box name first.

Delivery reports and read receipts in PHP mail

For the reading confirmations:

You have to add the X-Confirm-Reading-To header.

X-Confirm-Reading-To: <address>

For delivery confirmations:

You have to add the Disposition-Notification-To header.

For usage details see RFC 3798.


General tip for stuff like this:

Use the mail client of your choice to generate an e-mail with the desired parameters, send it to yourself and look at the mail source.

There you can find the necessary headers added by the feature you are looking for. Then read the RFC or google for specific details on the header in question.



Related Topics



Leave a reply



Submit