1.IIS4的SMTP.SMTP服务安装后,在你的system32目录
下会有一个文件叫CDONTS.DLL。请参考下面的源代码:
<%
Dim MailObject
Set MailObject = Server.CreateObject("CDONTS.NewMail")
att_file="c:/attachments/StandardPolicy.txt"
f_name="Policy.txt"
MailObject.From="stelede@ozemail.com.au"
MailObject.To="j_smith@zentus.com"
MailObject.Subject="Subject Text Here"
MailObject.Body="Body Text Here"
MailObject.AttachFile att_file,f_name
MailObject.Send
set MailObject = nothing
%>
或
<%Set objNewMail = CreateObject("CDONTS.NewMail")
'添加附件
objNewMail.AttachFile("//server/schedule/sched.xls", "SCHED.XLS")
objNewMail.Send("me@company.com", "you@company.com", "Hello", _
"I sent this in 3 statements!", 0) ' low importance
Set objNewMail = Nothing ' canNOT reuse it for another message
%>
给分把