Hi all
i have manage to make a php news letter script but would like to make it better for example, i would like to detect which emails have bounced and if possible away to detect when an email that as been sent as been opened any ideas
Thank you
Page 1 of 1
detecting if an email as been opened
#2
Posted 26 July 2009 - 11:02 AM
It's very difficult to detect when an e-mail has been opened since that happens on the client-side. In the past, examples would include a return receipt (which now tend to be disabled or blocked from being sent) or an image in an HTML e-mail which had its "src" coded to include some key (e.g. MD5 of the e-mail address) so when that image was loaded in the e-mail, the server could detect who had opened it. Of course, this quickly became abused so now many mail clients block linked images unless the user specifically permits them to be fetched and displayed.
One other way which seems quite common is to provide an HTML view which contains such an image, and also a plain-text link to a webpage containing the same newsletter. So either they choose to load the HTML view (and one of the loaded images will contain the unique ID for tracking purposes), or they can go to the identical webpage which has the unique ID built into the URL.
With regards to detecting blocked e-mails, there are two stages at which an e-mail can be blocked: at your application's sending stage (e.g. the SMTP server may be down or unable to forward mail for the supplied domain), or when your SMTP server attempts to deliver to the destination/next hop (e.g. because the mailbox does not exist or your IP is banned). In the former case your script should immediately become aware of the failure. In the latter case, you may (but won't necessarily) receive a bounce e-mail from your delivery SMTP server back to the Reply-To telling you that delivery was unsuccessful for whatever reason. Not all servers are configured to send bounce e-mails, particularly if your e-mail was binned as spam or the recipient does not exist - the lack of bounce messages is designed to counter spammers who forge sender addresses and try brute force approaches to random address bulk mailing.
If you are successful in getting bounce messages from some clients, you should be able to use POP or IMAP functions to scan the inbox (at the account to which bounces are delivered) for such notifications and take appropriate action. You might find it more convenient to run this from a script or executable as a scheduled task (e.g. cron job), rather than via a PHP/ASP page. You can of course program it in PHP/ASP and then use cron to regularly invoke that URL, if you don't have usage of other script types.
One other way which seems quite common is to provide an HTML view which contains such an image, and also a plain-text link to a webpage containing the same newsletter. So either they choose to load the HTML view (and one of the loaded images will contain the unique ID for tracking purposes), or they can go to the identical webpage which has the unique ID built into the URL.
With regards to detecting blocked e-mails, there are two stages at which an e-mail can be blocked: at your application's sending stage (e.g. the SMTP server may be down or unable to forward mail for the supplied domain), or when your SMTP server attempts to deliver to the destination/next hop (e.g. because the mailbox does not exist or your IP is banned). In the former case your script should immediately become aware of the failure. In the latter case, you may (but won't necessarily) receive a bounce e-mail from your delivery SMTP server back to the Reply-To telling you that delivery was unsuccessful for whatever reason. Not all servers are configured to send bounce e-mails, particularly if your e-mail was binned as spam or the recipient does not exist - the lack of bounce messages is designed to counter spammers who forge sender addresses and try brute force approaches to random address bulk mailing.
If you are successful in getting bounce messages from some clients, you should be able to use POP or IMAP functions to scan the inbox (at the account to which bounces are delivered) for such notifications and take appropriate action. You might find it more convenient to run this from a script or executable as a scheduled task (e.g. cron job), rather than via a PHP/ASP page. You can of course program it in PHP/ASP and then use cron to regularly invoke that URL, if you don't have usage of other script types.
#5
Posted 27 July 2009 - 12:06 PM
Connectu_C is totally hit the nail on the head again.
We do some statictic generation with mass mailing at work using something like:
<img src="http://domain.com/public/mail/image.php?id=434343" />
Then I have an image loading in image.php (using image magik or dg) which hits the database with details.
It's by far not the easiest thing not to do but at the same time not the hardest thing in the world to do.
It really depends on your server side coding knowledge!
We do some statictic generation with mass mailing at work using something like:
<img src="http://domain.com/public/mail/image.php?id=434343" />
Then I have an image loading in image.php (using image magik or dg) which hits the database with details.
It's by far not the easiest thing not to do but at the same time not the hardest thing in the world to do.
It really depends on your server side coding knowledge!
Share this topic:
Page 1 of 1
Help


















