现在的位置: 首页 > 综合 > 正文

mailto 用法

2013年10月02日 ⁄ 综合 ⁄ 共 1672字 ⁄ 字号 评论关闭

Opens a client's e-mail system.

Syntax

mailto:sAddress[sHeaders]

Tokens

sAddress
One or more valid e-mail addresses separated by a semicolon. You must use Internet-safe characters. Use %20 for the space character.
sHeaders
Optional. One or more name-value pairs. The first pair should be prefixed by a "?" and any additional pairs should be prefixed by a "&". The name can be one of the following strings.

subject
Text to appear in the subject line of the message.
body
Text to appear in the body of the message.
CC
Addresses to be included in the "cc" (carbon copy) section of the message.
BCC
Addresses to be included in the "bcc" (blind carbon copy) section of the message.

Remarks

For more information on the mailto protocol, see RFC 2368 World Wide Web link.

Available as of Microsoft Internet Explorer 3.0 or later.

Examples

The following example shows a mailto URL that will prepare an e-mail message when typed into the Internet Explorer address bar.

mailto:mtscf@microsoft.com?subject=Feedback&body=The InetSDK Site Is Superlative"

The following example shows a link that will prepare an e-mail message.

<A HREF="mailto:mtscf@microsoft.com?
    subject=Feedback&amp;
    body=The%20InetSDK%20Site%20Is%20Superlative">
    Click here to send feedback to the InetSDK.</A>

The following example shows a link that will prepare an e-mail message with multiple lines of text in the body.

<A HREF="mailto:mtscf@microsoft.com?
    subject=Feedback&amp;
    body=The%0d%0aInetSDK%0d%0aSite%0d%0aIs%0d%0aSuperlative">
    Click here to send feedback to the InetSDK.</A>

The following example shows how to use an HTML form to create an e-mail message.

<FORM ACTION="mailto:mtscf@microsoft.com" METHOD=GET>
<INPUT NAME=subject TYPE=hidden VALUE="InetSDK%20User%20Feedback">
Enter comments about this site:<BR>
<TEXTAREA NAME=body COLS=40>
InetSDK: http://msdn.microsoft.com/workshop/
The InetSDK site is superlative!
</TEXTAREA>
<INPUT TYPE=submit VALUE="Send Feedback">
</FORM>

抱歉!评论已关闭.