网页javascript提交outLook发送邮件

<script type="text/javascript">function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>
  网页Javascript提交OutLook发送邮件

< html >
< head >
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312"   />
< title > 网页Javascript提交OutLook发送邮件 </ title >
</ head >
< script  language ="javascript" >
function toOutLook(){
  
var objFrm = document.frmEmail;
    
var objFrmOutLook = document.frmEmailOutLook;
    
var msg = "";
    msg 
+= "姓名: " + objFrm.name.value + "  ";
    msg 
+= "电话: " + objFrm.phone.value + "  ";
    msg 
+= "网址: " + objFrm.website.value + "  ";
    msg 
+= "主题: " + objFrm.subject.value + "  ";
    msg 
+= "内容: " + objFrm.message.value + "  ";
    objFrmOutLook.message.value 
= msg;
    objFrmOutLook.action 
= "mailto:sundysea@hotmail.com?subject=" + objFrm.subject.value;
    objFrmOutLook.submit();
}

</ script >
< body >
< form  name ="frmEmailOutLook"  action =""  method ="post"  enctype ="text/plain" >
  
< input  type ="hidden"  name ="message"  value ="" >
</ form >

< form  name ="frmEmail"  action =""  method ="post" >
姓名:
< input  type ="text"  name ="name"  value ="a" >< BR >
电话:
< input  type ="text"  name ="phone"  value ="b" >< BR >
网址:
< input  type ="text"  name ="website"  value ="c" >< BR >
主题:
< input  type ="text"  name ="subject"  value ="d" >< BR >
内容:
< textarea  name ="message"   > ee
ddd
</ textarea >< BR >
< input  type ="button"  name ="send"  value ="send"  onClick ="toOutLook()" >
</ form >
</ body >
</ html >


点击Send发送之后的内容为

----------------------------------------
收件人: sundysea@hotmail.com
主题: d

message=姓名: a
电话: b
网址: c
主题: d
内容: ee
ddd 
----------------------------------------

注意的几个地方:

默认发送格式为表单名称=内容.
所以在上面我做了两个表单,先组合好内容,然后发送,这样就只有一个表单,而且内容前面有说明(表单的说明)

表单的属性设置,增加enctype="text/plain"(是以文本方式发送),或者 ENCTYPE="multipart/form-data"(是将文本打包成附件**.ATT的附件)
<form name="frmEmailOutLook" action="" method="post" enctype="text/plain">

发送表单action的格式
mailto:目的邮件地址?subject=邮件主题&Bcc=转送(不记得了)&cc=抄送
(转自 feng_Sundy的专栏 CSDN)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值