用CDONTS发送邮件的两个函数
类别: ASP教程
用cdonts发送邮件的两个函数,非常好用,快记录下来!
<%
sub sendmail(fromwho,towho,subject,body)
dim cdo
set cdo=server.createobject("cdonts.newmail")
cdo.From=fromwho
cdo.To = towho
cdo.Subject =subject
cdo.Body =body
cdo.MailFormat=0
\'说明是以MIME发送
cdo.BodyFormat=0
\'可以包含html代码
cdo.Importance=0
\'邮件的优先级别0-1-2
\'cdo.cc=xx@xx.net 抄送
\'cdo.Bcc=xx@fcxx.net密送
\'cdo.AttachFile "" 附件
cdo.Send
Set cdo=Nothing
end sub
sub sendattachmail(fromwho,towho,subject,body,attachfile)
dim cdo
set cdo=server.createobject("cdonts.newmail")
cdo.From=fromwho
cdo.To = towho
cdo.Subject =subject
cdo.Body =body
cdo.MailFormat=0
cdo.BodyFormat=0
cdo.Importance=0
cdo.AttachFile attachfile
cdo.Send
Set cdo=Nothing
end sub
%>
<%
sub sendmail(fromwho,towho,subject,body)
dim cdo
set cdo=server.createobject("cdonts.newmail")
cdo.From=fromwho
cdo.To = towho
cdo.Subject =subject
cdo.Body =body
cdo.MailFormat=0
\'说明是以MIME发送
cdo.BodyFormat=0
\'可以包含html代码
cdo.Importance=0
\'邮件的优先级别0-1-2
\'cdo.cc=xx@xx.net 抄送
\'cdo.Bcc=xx@fcxx.net密送
\'cdo.AttachFile "" 附件
cdo.Send
Set cdo=Nothing
end sub
sub sendattachmail(fromwho,towho,subject,body,attachfile)
dim cdo
set cdo=server.createobject("cdonts.newmail")
cdo.From=fromwho
cdo.To = towho
cdo.Subject =subject
cdo.Body =body
cdo.MailFormat=0
cdo.BodyFormat=0
cdo.Importance=0
cdo.AttachFile attachfile
cdo.Send
Set cdo=Nothing
end sub
%>
- 上一篇: 在ASP中使用“REQUEST”时应注意的问题
- 下一篇: FILE控件如何RESET
-= 资 源 教 程 =-
文 章 搜 索