ASP CDONTS. NewMail components send email (download included)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.