asp使用jmail4.3的模块 asp使用jmail4.3的模块
来源:互联网 发布:网络跟同轴探头的区别 编辑:程序博客网 时间:2024/06/06 21:40
常常要在网站中使用到JMAIL组件来发邮件。干脆就把常用的功能写成一个模块,方便调用。
把程序放到一个文件中,然后包含再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
%>
- asp使用jmail4.3的模块 asp使用jmail4.3的模块
- JMAIL4.3 exp
- Jmail4.3发送邮件例
- jmail4.1用pop3收信的例子
- ASP中使用C#编写的模块(程序集)
- .net 利用 Jmail 发送邮件(实例和Jmail4.3组件下载)以及Jmail参数说明
- 后台登陆模块(ASP.NET内置票据认证的使用)
- CMEM模块的使用
- mc703模块的使用
- python_bisect模块的使用
- python_glob模块的使用
- logging模块的使用
- Devel模块的使用
- 蓝牙模块的使用
- linux 模块的使用
- paramiko模块的使用
- python_glob模块的使用
- smtplib 模块的使用
- Mono初体验
- ASP代码变成组件 加快ASP的速度(转贴)
- 分享:安全存放web项目数据库连接字符串
- 虚拟机概论(二)——译者序
- 分享:从my.msn.com抄来的htc菜单控件
- asp使用jmail4.3的模块 asp使用jmail4.3的模块
- asp查看系统用户和进程的代码
- 改进版本的五子棋
- SQL注入与ASP木马上传
- 提问:我的access数据库,在2000系统连接不上,是怎莫会事啊
- 在ASP中用集合成批操作数据库
- 不通过数据源完全控制MDB数据库
- ASP访问SQL Server内置对象
- ASP模板技术