Add A Subject And Body Text To A HTML Mailto Command

This is not really my sort of thing but I noticed that when companies  have enquiry email addresses they sometimes automatically fill the subject field in the email and sometimes even fill part of the email body out. I was wondering how they did this so had a dig into it.

So normally you use the command below to email Allen.white@techieshelp.com making sure you open and close the command with < and >.

<a href="mailto:allen.white@techieshelp.com">Allen.white@techieshelp.com</a>

As you will see if you click on the email address above it will open up your mail client and populate the email field. To add a subject use the command below.

<a href="mailto:allen.white@techieshelp.com?Subject=Enter your subject here">Allen.white@techieshelp.com</a>

Now you will see that if you click on Allen.white@techieshelp.com you will see that the subject field is populated.

Finally, if you would like to add content to the body of the email use the command below.

<a href="mailto:allen.white@techieshelp.com?Subject=Enter your subject here&body=whatever txt you want in the body">Allen.white@techieshelp.com</a>

So now when you click on Allen.white@techieshelp.com you will see the body and field is pre populated in the email

Tags: html

Allen White

Allen is a Consultant for ITPS in the North East of England and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5 and HP ASE, AIS - Network Infrastructure.

Leave a comment

Categories

Vote!

What Web Browser Do You Use?

View Results

Loading ... Loading ...

Vote!

What do you prefer..VMware or Hyper-V?

View Results

Loading ... Loading ...