ITPub博客

首页 > IT基础架构 > 网络安全 > 常用Email组件发送函数 (转)

常用Email组件发送函数 (转)

原创 网络安全 作者:worldblog 时间:2007-12-13 11:43:25 0 删除 编辑
常用Email组件发送函数 (转)[@more@]

<%
 sub JMail(email)
 Dim jmail,sendmail
 Set JMail=Server.Createobject("JMail.SMTPMail")
 JMail.Logging=True
 JMail.Charset="gb2312"
 JMail.ContentType = "text/html"
 JMail.ServerAddress=SMTPServer
 JMail.Sender=SystemEmail
 JMail.Subject=topic
 JMail.Body=mailbody
 JMail.AddRecipient email
 JMail.Priority=3
 JMail.Execute
 Set JMail=nothing
 if err then
 SendMail=err.description
 err.clear
 else
 SendMail="OK"
 end if
 end sub

 sub Cdonts(email)
 dim  objCdomail
 Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
 objCDOMail.From =SystemEmail
 objCDOMail.To =email
 objCDOMail.Subject =topic
 objCDOMail.Body =mailbody
 objCDOMail.Send
 Set objCDOMail = Nothing
 if err then
 SendMail=err.description
 err.clear
 else
 SendMail="OK"
 end if
 end sub

 sub ASPemail(email)
 Set mailer=Server.CreateObject("ASPMAIL.ASPMailCtrl.1") 
 recipient=email
 sender=SystemEmail
 subject=topic
 message=mailbody
 mailserver=SMTPServer
 result=mailer.SendMail(mailserver, recipient, sender, subject, message)
 if err then
 SendMail=err.description
 err.clear
 else
 SendMail="OK"
 end if
 end sub
%>


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-992729/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    6241
  • 访问量
    2411032