CodingLearnNew

Getting Started with MailTo

Ever wonder how you click on a link and like magic it opens Outlook and has an email formatted with the ToSubject and a message already filled in?

Below we provide a few details on how just to do that.

The Code

This opens the user’s default mail program, creates a new message with the TO field already filled out.

<a href="mailto:test@someone.com">Email Us</a>

Pre-filled Address and Subject Line

This opens the user’s default mail program, creates a new message with the TO field already filled out. We also fill the SUBJECT line.

 

<a href="mailto:test@someone.com?subject=New Mail">Email Us</a>

Pre-filled Address, Subject Line and message (body)

This opens the user’s default mail program, creates a new message with the TO field already filled out. We also fill the SUBJECT line and add in a message (body) of the email.

<a href="mailto:test@someone.com?subject=New Mail&body=Hi">Email Us</a>