HTML emails….. hmm, not such a good idea.
I am not such a big fan of HTML emails, because I am assaulted by tens of such emails daily, most of them spam ones. And using Microsoft Outlook as email client, it ask me to download (or not) pictures from the server. This could be a bad idea sometimes, because harmful code could be be hidden in image files today (especially GIF files).

I was hired to make a newsletter module for one website and first I started to search how to make this.
The steps are below.

1. Create the HTML page for newsletter.
2. Take care to have the CSS and JS embedded in the HTML file and not outside the file.
3. Replace the relative location of image files with absolute location. E.g:
if you have:
[code lang=”xml”]
Coming Soon
[/code]
you must replace with:
[code lang=”xml”]
Coming Soon
[/code]

4.1. If you want to send the email by Outlook Express, you need to open a new e-mail window, choose File » New » Mail Message. Once your mail window is open, make sure the format is set to Rich Text (HTML) by choosing Format and making sure there is a highlight next to the Rich Text (HTML) line.
Once your e-mail is set to Rich Text, choose View > Source Edit and you should see three tabs at the bottom of your mail message.
Click the Source tab, and you’ll see the HTML source for your default e-mail message. Copy and paste all your HTML code into Outlook Express Source view.
After you’ve pasted your HTML code, you can click the Preview tab to see how it will look in Outlook Express. Now all you have to do is type in your recipient’s addresses, and click “Send”.
4.2. Dinamically send via PHP. First of all you must assign all the HTML to a variable. Take care to escape double quotes. Then send via mail() function like the following:
[code lang=”php”]




Newsletter