I am looking for creative heuristics to detect if an HTML email was not just opened, but also likely read.
Currently, we embed an img tag linking to a PHP script, which marks anonymously in the database that the email was opened. (We can assume here that the users we're interested in told Outlook it was OK to display the images.)
This method is okay, but it's hard to tell what it means - if they clicked the email just to get it marked as read, if they keyed through it while skipping through other mails, or if they genuinely read and enjoyed the email.
My latest try was to implement a delay of 10 seconds on the image download before making the database call marking the mail as read, however it seems that Outlook finishes the request in the background, even if they skip out of the email. Does anyone have any creative recommendations that may work better?
It's kind of unethical in my opinion to do this without your user's knowing. That's why so many email clients go to measures to protect against this.
I know this might not really help you, but if your user genuinely read and enjoyed the email couldn't you just add an HTML anchor in the email that they can click on to go to your website and you can add a tracking code to that to figure out who it was / which email address clicked on the link at the bottom of your email. Something along those lines just seems like a better method to me. Maybe that's just me though.
Hmm, tough one without the use of javascript, and as we know, most email clients have their security too high to use javascript.
Not putting much thought into it, could you use PHP's shutdown function, and have the image "loop" load....basically meaning that the image will never completely load because we are stopping it on the server side with a loop. Will Outlook still try and download the image after a timeout - will it timeout?
It seems like you are dealing with two different issues...trying to harness Outlook and trying to do something that most people don't want.
This is why there are offers and links like "click here for 10% off coupon" or "read more".
From a marketing standpoint this would be a true test if people are interested in your emails....but I guess that wasn't your question ;)
Related
Is there another way to detect if a HTML email was opened by the target besides that strategy of adding a <img src="site.com/someScript.php?var=email"/> in the body of the message? I'm for some hours looking for this at the internet but all sites I found was about using this strategy which is almost certain that is gonna be blocked by a good portion of users (outlook for example).
I mean, there must be a guaranteed way, if mailChimp does it, I wanna do it too! Thanks in advance.
My client is a restaurant that needs to change a paragraph section (<P>) every day for specials.
There are many people that will be handling it so I have to make it as easy a possible.
I don't think teaching the whole staff how to use a CMS is feasible, so I thought it would be a good idea to make something like an email service, that only updates that bit of text.
So in other words the staff would just have to send an email, and the server would somehow change the text on the HTML page for that day.
Can I do this in PHP code maybe?
I am also open to other ideas to something easy, like a simple login system to just change that bit of text.
I wouldn't recommend setting the text by e-mail. E-mail is an ugly, UGLY format to process, especially if it is sent by humans on every type of broken e-mail clients. The half of the e-mails will be invalid HTML, the other half will be tabulated unimaginably, the third half will contain signatures and there are so many more halves :)
And explaining the e-mail format you expect to the staff (utf-8 plain text with no signatures, etc...), and how to set it on their Outlook Expresses, Netscape Mails, and web clients you never even heard of, will be just as difficult as explaining a CMS.
What I would recommend is a simple form instead. If you open the form the current text could show up in a text field, and upon posting back the form you save it's contents on the server.
You would need to store this text somewhere. There is very few servers that host web applications without some form of database backends, so I'm pretty sure you have some kind of database to store your text in.
Also the form would need some kind of password protection. The easiest would be IMHO to password protect the folder where your php is. It's not too hard in Apache.
Check this link: http://www.groovypost.com/howto/htaccess-password-protect-apache-website-security/
I'm not familiar with your experience in PHP, but I hope you can make a form to edit a database record. If not, then please use google, there are tons of tutorials on it.
You could use imap extension http://php.net/manual/en/book.imap.php it allows you to read emails from email box. usualy, programmers create keywords that act like commands to script, for example, if title of email is match pattern UPDATE pageID then it will process email body as content for this page.
This script will be running with crontab, which is scheduler for unix OS. So you can run it every 1 hour for checking new mail.
maybe your client could send an excel sheet and you parse this email attachment on server side with php.
https://code.google.com/p/php-excel/
One option is to use a blogging platform to post the latest specials. You could then use PHP to grab the RSS output (last feed item) and populate the website. This would take care of the form, log in and security part. It also gives the client a running history.
(if you want to go this route I can post an rss reader php script to help you out)
Alternatively, if you decide to go the email route, put the text between something like this:
<!-- PUT PARAGRAPH HERE -->
Here is today's specials.
<!-- /PUT PARAGRAPH HERE -->
Can be anything really, but bookending it with something constant you can search for in the string will help avoid many of the issues mentioned by #SoonDead above. PHP can convert it into something consistent, but you'll need some php knowledge to make it work.
Is it possible to include a separate html page in a php email?
Example, create a separate page that has all the content on it I want to email it and then include it in a php mail() on another page as the message?
Thanks
If you meant sending HTML email, yes. You can do that. You just need to add additional headers in the fourth parameter of mail() and pull the information from the HTML file you have using file_get_contents(). Please check this:
http://css-tricks.com/sending-nice-html-email-with-php/
Yes, it's possible exactly how rationalboss explained. Personally I use PEAR for html emails. It's a pain to get started with if you're not familiar to PEAR, but life has improved once I got it going.
Careful though, html/css does not have the same support in email clients that it does in browsers. You can create a beautiful page and find out that most people receive it with huge glitches due to certain CSS rules being ignored.
Best practice last I heard is to keep it simple and use inline styles for everything. Avoid floats and positioning. In fact, I believe it is actually still safer to use tables when dealing with email layouts if you need things to sit next to each other.
And then test in as many email clients as you can. Then cry and try to fix things.
I hear good things about Email on Acid for testing. It's a pay service but they offer a limited test for 3 clients as well.
If you're just doing a relatively simple email then it shouldn't be too bad. But if you're trying to make something that really looks great I recommend doing some googling on styling html specifically for emails.
I have seen a few companies recently that are releasing "live" email content. This basically means that each time you open the email the content changes. I have looked into this and it appears that not only the image, but the text of these emails is also changing. . .
The only possibility that I have thought of to do this is with an iframe or changing images with the same url.
Does anyone have an idea of how this is being accomplished ? \
It would be easiest to find out if you just looked into the source code of one of those live emails.
Otherwise the most likely solution are <iframe>s. The support in mail clients is not encompassing however: http://www.campaignmonitor.com/blog/post/3219/do-iframes-work-in-email/
So I would assume this is mostly used for small areas, and/or with an <iframe ..><p>alternative content</p></iframe> area. That's the most likely approach to follow in lieu of scripting support.
The exchanging <img> variant is more widely supported, but harder to implement. You would need to take a screenshot of your website, and link it remotely in the mail. You can mitigate the non-clickability with an <area> but would have to ensure that your website screenshot doesn't change the layout then - because you can only ever adapt the remote image, not the sent html emails.
It's quite possible that both approaches might be combined. But it's quite some effort to provide an iframe and a static img screenshot as alternative. Only one thing is for sure, embedded Flash content can be ruled out for your "live" emails. http://www.campaignmonitor.com/blog/post/1974/the-truth-about-1/
I am displaying the email addresses stored in the database on a page using PHP.
The email address on a page is displayed as below:
Email: test#example.com
Now the email address shown on a page should use JS spam protection to hide it from spam bots.
Try an email encoder, or implement one in your script.
you can try to use image (with php-gd lib) write on a image then show this. (like facebook)
Here are some good resources to look at:
Hiding Email from Spam Bots
Displaying Emails for Users, But not Spambots.
Making Email Addresses Safe from Bots
You could probably find more using a Google Search of StackOverflow.com
Oh, and there are ones asking if you 'should' do it:
Does Hiding Emails really make it harder?
Do You Hide Email from Spam Bots on Websites
I'd argue that you're better off not bothering; client-side spam filters are pretty good these days, and by jumping through hoops youjust make thing harder for humans.
That said, the best way is to convert it to whatever kind of format you want, whether it's an image or a simple string substitution:
joe#domain.com -> joeATdomainDOTcom
and then write the address out marked up with some kind of class identifier:
<a href="mailto:joeATdomainDOTcom" class="Email">
<!-- image or link text here -->
</a>
Then use Javascript to decode all the email links and re-write the href attribute to the real address. Most spiders crawling for email addresses won't execute Javascript, so the encoded semi-useless address is all they'll see.
Users with JS enabled will get more or less expected functionality (clickable mailto links) while users without JS will at least get human-readable addresses.
The worst thing you can do is write the unencoded addresses out, and trust some Javascript to hide them.
PHPEnkoder (a port of Hivelogic's The Enkoder)
"Enkoder, which works by randomly encoding a piece of text and sending to the browser self-evaluating Javascript that will generate the original text. This works in two ways: first, a bot must first have a fairly complete Javascript implementation; second, the decoding process can be made arbitrarily computationally intensive."
It's BSD-licensed.
Try http://recaptcha.net/learnmore.html It can protect email addresses with a captcha..never tried it though, but i uses reCaptcha for a login form and it was easy to work with.
Displaying them as pictures is one option. Also requiring the user to pass CAPTCHA test before seeing the e-mail address works too. Combine those two and spam bots will likely never get the e-mail addresses.