Jmail4.3发送邮件例

把程序放到一个文件中,然后包含再call就可以了。(JMAIL4.3) <%'警告函数 sub w_msg(message,w_to,w_link) 'message是你要弹出的警告信息,w_to=1表示自动后退一页,当w_to<>1时w_link表示要跳转的页面 if w_to="1" then %> <script language="javascript"> <!-- function Index(){ window.alert('<%=message%>');history.back(-1)} Index(); --> </script> <%else%> <script language="javascript"> <!-- function Index(){ window.alert('<%=message%>');window.location="<%=w_link%>"} Index(); --> </script> <%end if end sub%> <% sub sendmail(mailtitle,mailtext,mailaddress,mailcc,mailbcc,attachment,mailserver) if mailtitle="" then mailtitle="系统测试邮件" end if if mailtext="" then mailtext="Just a test" end if if mailaddress="" then call w_msg("邮件地址不能为空","1","") end if if mailserver="" then mailserver="smtp.163.com" end if set msg=server.createobject("JMail.Message") msg.silent = true msg.logging = true msg.Charset="GB2312" msg.ContentType = "text/html" msg.MailServerUserName="yourusername" msg.MailServerPassword="yourpassword" msg.From="youremail" msg.FromName="dorryyang" mailaddress_s=split(mailaddress,",") ' 邮件地址用,格开 for i=0 to ubound(mailaddress_s) msg.AddRecipient trim(mailaddress_s(i)) next if mailcc<>"" then mailcc_s=split(mailcc,",") for i=0 to ubound(mailcc_s) msg.AddRecipientCC trim(mailcc_s(i)) next end if if mailbcc<>"" then mailbcc_s=split(mailbcc,",") for i=0 to ubound(mailbcc_s) msg.AddRecipientBCC trim(mailbcc_s(i)) next end if if attachment<>"" then msg.AddAttachment(attachment) 'attachment写附件地址 end if msg.Subject=mailtitle msg.HTMLBody=mailtext msg.Send(mailserver) msg.close set msg=nothing call w_msg("发送成功","1","") end sub %>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值