RSS feed
<< January 4, 2008 | Home | January 6, 2008 >>

Hacking HTML email

If you use a GUI email client and you're trying to edit your HTML email to look just so, it can feel like riding a bike with training wheels that won't come off. HTML has introduced a very powerful way to communicate over email. Many email clients prevent us from making the sort of changes we'd like to the body of our email. Try adding background music to your email in Microsoft Outlook for example. Or try changing the name of the recipient to "Undisclosed recipients". If you have a Linux machine, the solution is simple, use the sendmail command.

$ /usr/sbin/sendmail them@someisp.net < mail.msg

If you're on a Windows machine, there is no sendmail command and what's worse, you're probably sending your email to an exchange server that will reject your email if it doesn't like what it sees. I've written a a Java applet to get around these limitations. I've also included a sample email to send to demonstrate including background music.

Test the form with your own information to make sure you have it working properly with information you know should work, then modify it to suit your needs.

  1. Find the name of your SMTP server and put this name in the server field.
  2. Replace the "From' field, the "To" field and the "To" information in the message body with your email address. Make sure you replace Undisclosed recipients with your real name.
  3. Click send.

The first step is by far the hardest step in this process. Tool | E-mail Accounts | "View or change existing e-mail accounts". Select the accounts you want to use and click "Change...". You should see the "Outgoing mail server (SMTP). If you're using exchange then use the "Microsoft Exchange Server" as the SMTP server.

The following code includes background music in the message. Replace the text between the boundary tags with the text below.

Content-type: text/html

<DIV dir=ltr align=left><SPAN 
class=668451817-03012008>Can you hear this music?</SPAN></DIV><BGSOUND 
balance=0 src="http://www.jhpro2.com/email_audio/CrazyEmail.mp3" volume=0 
loop=infinite>

If you're using a Microsoft Exchange server, I should warn you, they have the most convoluted rules I've ever seen for accepting emails. The sample background music email will fail if it's modified even slightly.

This example used to cause the email client to crash.

Content-type: text/html

<html>
<form>
<input type crash>
</form>
</html>
<< January 4, 2008 | Home | January 6, 2008 >>