Set MyMail2 = CreateObject("CDONTS.NewMail")
HTML = "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Sending CDONTS Email Using HTML</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"">"
HTML = HTML & "<p><font size=3>"
HTML = HTML & "This is a test mail in html<br>"
HTML = HTML & "Mail content here ...</font></p>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
MyMail2.From= "somebody@somewhere.com"
MyMail2.To="nobody@somewhere.com"
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= "somebody@nowhere.com"
MyMail3.To= "nobody@nowhere.com"
MyMail3.Cc="nobody2@nowhere.com"
MyMail3.Subject="This is a Test"