用cdonts发送邮件的两个函数,非常好用,快记录下来!
--------------------------------------------------------------------------------
freezwy 于 2001-6-29 11:47:02 加贴在 Joy ASP ←返回版面
<%
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
'
[email protected] 抄送
'
[email protected]密送
'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
%