常用Email元件傳送函式 (轉)

worldblog發表於2007-12-13
常用Email元件傳送函式 (轉)[@more@]

 sub J()
 Dim ,
 Set JMail=Server.Create("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  objCail
 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 email(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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章