首页  »  网页设计教程  »  常用Email组件发送函数

常用Email组件发送函数

浏览数:共 550 次     评论:共 0 条     发布日期:2011-08-17     分类:asp

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

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

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



上一篇:利用SQLSERVER存储过程实现ASP用户身份验证
下一篇:在ASP中自动创建多级文件夹的函数 利用FSO