With Cdont.newmail components: Http://files.cnblogs.com/files/colinliu/cdonts.rar
ASP General Send method:
<% Dim mail Set Mail=server.createobject ("Cdonts.newmail") mail. From=fromwho "Sender mailbox mail. to = towho "Recipient mailbox mail. Subject =subject "Theme mail. Body =body "message body mail. Mailformat=0 "instructions are to send mail in mime. Bodyformat=0 "can contain HTML code mail. Importance=0 "Mail priority 0-1-2 [email protected]" cc [email protected] "Send mail. Attachfile attachfile "Attachment mail. Send Set mail=nothing Response. Write "<script language= ' JavaScript ' >alert (' email sent ');</script>"%>
Read HTML and send!
<%dim FSO, Tfdim strhtmlset fso = Server.CreateObject ("SCRIPTING. FileSystemObject ") Set tf = fso. OpenTextFile ("C:\Mail.htm", 1) strhtml = tf. Readallwrite strhtmlset tf = NothingSet FSO = NothingSet objmail = Server.CreateObject ("CDONTS". NEWMAIL ") Objmail.from =" [email protected] "objmail.to =" [email protected] "Objmail.subject =" TEST7 "Objmail.body = Strhtmlobjmail.bodyformat = 0objmail.mailformat = 0objmail.importance = 2objmail.attachurl "C:\logo.gif", "logo.gif" Objmail.sendset objmail = Nothingresponse.write "<script language= ' JavaScript ' >alert (' e-mail sent '); </ Script> "%>
Finish
ASP CDONTS. NewMail components send email (download included)