- Skill level:
Other People Are Reading
Things you need
- Text editor program (such as Microsoft's Notepad)
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.
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" />
<input type="button" value="Send" onclick="document.location.href='mailto:'+document.getElementById('mTo').value+'?subject='+document.getElementById('mSubject').value+'&body='+document.getElementById('mBody').value" />
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.
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.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for