如何打开email客户端?

glooby 2007-01-17 01:18:26
我一个webpage上有一个button, 我希望点击之后能打开email编辑器(outlook),并且能够在其中填入server传过来的to, cc, body, subject等信息。 该如何做?
...全文
559 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jacobzhang 2007-02-23
  • 打赏
  • 举报
回复
var oEmailThis = document.getElementById('emthis');

function emThis()
{
var sSubject = "Email Title Text";
var sBody = "Email Content Text";
var et='mailto:?subject=' + sSubject + '&body=' + sBody;
window.open(et);
return false;
}

function initialEmailAFriend()
{
oEmailThis.attachEvent("onclick", new Function("emThis()"));
}

initialEmailAFriend();

Eilien 2007-01-23
  • 打赏
  • 举报
回复
mark
xxuu503 2007-01-23
  • 打赏
  • 举报
回复
mailto Protocol

--------------------------------------------------------------------------------

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 .

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&
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&
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>

--------------------------------------------------------------------------------

© 2003 Microsoft Corporation. All rights reserved.
wshuangminlg 2007-01-17
  • 打赏
  • 举报
回复
帮LZ顶~~
btbtd 2007-01-17
  • 打赏
  • 举报
回复
一般是传个网址了事了, 没必须多详细...
glooby 2007-01-17
  • 打赏
  • 举报
回复
用mailto无法传值,如果把值按下格式maito:abc@microsoft.com?subject=...&body=.. 也不行,我试过,长度有限制
glacier111 2007-01-17
  • 打赏
  • 举报
回复
打开
<a href="mailto:cms@ladhs.org" class="quicklink">Forgot My Password</a>

传值不太明白

87,917

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧