常用Email组件发送函数

作者:网络 来源:佚名 更新时间:2008-02-05 18:19:24 点击:
<%
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
%>