WEB开发网
开发学院WEB开发ASP 常用Email组件发送函数 阅读

常用Email组件发送函数

 2005-03-23 10:32:00 来源:WEB开发网   
核心提示:<% sub jmail(email) Dim JMail,SendMail Set JMail=Server.CreateObject("JMail.SMTPMail") JMail.Logging=True JMail.Charset="gb2312" JMail.Co

<%
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
%>

Tags:常用 Email 组件

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接