How to Invoke Outlook Express Using JavaScript & HTML

Written by rachel smith
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Invoke Outlook Express Using JavaScript & HTML
HTML form data can be sent to your default e-mail client. (e-mail simbol image by vladislav susoy from

If you want your website to use JavaScript and hypertext markup language (HTML) to populate the fields of a new e-mail message in Microsoft's Outlook Express, then the end user must have Outlook Express set as his web browser's default mail client. How he does that depends on which web browser he chooses. The project also requires you to make a simple web page with an HTML form attached to a short JavaScript that will pass the end user's input to his e-mail client.

Skill level:

Things you need

  • Text editor program (such as Microsoft's Notepad)

Show MoreHide


  1. 1

    Set Outlook Express as the default e-mail application if it is not already the default. This can be done only from within the settings of the web browser on the end user's computer. If you do not have access to that computer, then the end user may have to be instructed to set the default e-mail client. This matters only if you care whether or not Outlook Express is used. The task is accomplished differently in each brand of web browser. In Mozilla Firefox, for example, click on "Tools" in the window's top menu bar. Then select "Options" in the submenu and the Applications tab in the Options window. Set the "Action" for the "mailto" "Content Type" to Outlook Express.

  2. 2

    Write an HTML form using a text editor program. The form gives the end user a place to type information to be sent to Outlook Express. An <input> element can be used for the recipient and subject, and a <textarea> can be used for the main body of the message. An example of HTML code for the form is:

    To: <input type="text" id="mTo" />

    Subject: <input type="text" id="mSubject" />

    <textarea id="mBody"></textarea>

  3. 3

    Create an HTML button with a line of JavaScript code in the "onclick" event handler. The JavaScript will send the form data to the end user's e-mail client. The HTML/JavaScript for the button that needs to be added is:

    <input type="button" value="Send" onclick="document.location.href='mailto:'+document.getElementById('mTo').value+'?subject='+document.getElementById('mSubject').value+'&body='+document.getElementById('mBody').value" />

  4. 4

    Save the file in your text editor program. In Notepad, select "File" from the menu bar and then "Save" or "Save As" from the submenu that appears. Within the "Save" dialogue, change the "Save as type" drop-down menu from "Text Documents (*.txt)" to "All Files." Set the "File name" field to anything you like, but it must have an ".htm" extension. Then click on the "Save" button.

  5. 5

    Test your script. Open the file you just saved. By default, it should open in your web browser. Enter information into the form fields, and then press the button to ensure everything works properly.

Tips and warnings

  • Only the end user can alter a web browser's e-mail client preference. Consider the fact that an end user may choose an e-mail client other than Outlook Express as her browser's default.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.