windows虚拟主机CDONTS组件发信支持的方法?
发布日期:2015-12-3 15:12:57
CDONTS支持如下的方法:
<%set mymail="CreateObject('CDONTS.NewMail')
"
HTML = HTML & "This is a test mail in html
"
HTML = HTML & "Mail content here ...
"
HTML = HTML & ""
HTML = HTML & ""
MyMail2.From= "test@hichina.com"
MyMail2.To=test@net.cn
MyMail2.Subject="Test mail in HTML"
MyMail2.BodyFormat=0
MyMail2.MailFormat=0
MyMail2.Body = HTML
MyMail2.Send
set MyMail2=nothing
%>
总之,用标准的HTML即可。如何使用CDONTS组件发含附件的信件?
<%
Set MyMail3 = CreateObject("CDONTS.NewMail")
MyMail3.From= "test@hichina.com"
MyMail3.To= "test@net.cn"
MyMail3.Cc="test@com.cn"
MyMail3.Subject="This is a Test"MyCDONTSMail3.AttachFile Server.MapPath("C:\inetpub\wwwroot\somedirectory\anyfile.txt")
MyBody2 = "Thank you!" & vbCrLf
MyBody2 = MyBody2 & "Your information will be send to me!" & vbCrLf
MyBody2 = MyBody2 & "Welcome in http://service.hichina.com !"
MyMail3.Body= MyBody2
MyMail3.Send
set MyMail3=nothing
%>