sub sendmail(a_intid , a_stremail)
const c_strmailserver = "smtp.163.net"
dim objconn,objrs,strsql
dim strcontent,strbody,strsubject,objemail
strbody = "<html><head>"
strbody = strbody + "<meta http-equiv=content-type content=text/html; charset=gb2312>"
strbody = strbody + "</head><body bgcolor=#d2b48c>"
strbody = strbody + "<a href='http://www.china-168.net/center/default.asp>" + "<img src=http://www.china-168.net/center/images/banner.gif border=0>" + "</a>"
strbody = strbody + "<h3 style='font-size: 15px'>" + "请您确认" + "</h>" + vbcrlf
strbody = strbody + "<p style='font-size: 13px'>" + "您好<a href=mailto:"&a_stremail&">"&a_stremail&"</a>" + "</td>" + vbcrlf
strbody = strbody + "<p style='font-size: 13px'>" + "欢迎您订阅万里信息网邮件列表" +"</td>"
strbody = strbody + "<p style='font-size: 13px'>" + "为了防止出现订阅错误,请您点击以下链接进行确认。谢谢!" + "</td>"
strbody = strbody + "<p style='font-size: 13px'>" + "<a href=""http://www.china-168.net/emaillist/affirm.asp?mode=maillist&content="&a_stremail&""">" + "请点击这里,进行订阅确认" + "</a>"
strbody = strbody + "<p style='font-size: 13px'><a href=http://www.china-168.net target='_blank'>" + vbcrlf
strbody = strbody + "<img src=http://www.china-168.net/images/logo.gif"
strbody = strbody + " alt='更多信息尽在万里信息网'></a>
"
strbody = strbody + "<p style='font-size: 13px'>" + "欢迎再次光临万里信息网!" + "</td>"
strbody = strbody + "</body></html>"
'发送email
on error resume next
set objemail = server.createobject("persits.mailsender")
objemail.host = c_strmailserver
objemail.from = "jiabaoxu@163.net"
objemail.fromname = "china-168.net"
objemail.addaddress a_stremail
objemail.subject = "订阅确认"
objemail.ishtml = true
objemail.charset = "gb2312"
objemail.body = strbody
objemail.send
'检察错误
if err.number = 0 then '如果成功
response.write ("<p align=center class=cn>为确保用户不被骚扰,我们将发出确认信,请访问信中的url以确认登记</td>")
else '如果失败则显示出错原因
response.write ("<p align=center class=cn>邮件发送出错,错误原因:
")
response.write ("<font color=red>"&err.description&"</font></td>")
end if
'清场
set objemail = nothing
end sub
使用该过程:
<%
.....
rtsemail guestmailid,""&email&""
.....
%>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器