<% Set MyMail2 = CreateObject("CDONTS.NewMail") HTML = "" HTML = HTML & "" HTML = HTML & "<span style="font-family: 微软雅黑, 'Microsoft YaHei'; font-size: 14px;">Sending CDONTS Email Using HTML</span" HTML = HTML & "" HTML = HTML & "" HTML = HTML & "
" 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 %>