我想创建一个客户端邮件创建者网页.我知道在html表单中使用mailto操作的问题(非标准,客户端上没有设置默认邮件应用程序).但网页不是很重要,他们并不在乎.
mailto操作创建的邮件具有以下语法:
主题:未定义的
主体:param1 = value1
param2 = value2
.
.
.
paramn =值N
我可以使用JavaScript来格式化这样的邮件吗?
主题:XXXXX
正文:Value1; Value2; Value3 ... ValueN
Vin*_*ert 17
我们在projet中使用的是一个打开mailto:链接的弹出窗口,这是我们发现在默认邮件客户端中编写邮件的唯一方式,该邮件客户端适用于所有邮件客户端(至少我们使用的所有客户端).
var addresses = "";//between the speech mark goes the receptient. Seperate addresses with a ;
var body = ""//write the message text between the speech marks or put a variable in the place of the speech marks
var subject = ""//between the speech marks goes the subject of the message
var href = "mailto:" + addresses + "?"
+ "subject=" + subject + "&"
+ "body=" + body;
var wndMail;
wndMail = window.open(href, "_blank", "scrollbars=yes,resizable=yes,width=10,height=10");
if(wndMail)
{
wndMail.close();
}
Run Code Online (Sandbox Code Playgroud)
通过浏览器发送邮件时,您或多或少只有两种选择.