Do not register components under Windows 2003 use Cdo.message to send mail

Source: Internet
Author: User
Tags command line mail
window| Email | Registration component In fact, ASP can do a lot of things, but we do not know how to use. Microsoft provides ASP with a lot of out-of-the-box useful components that no one knows about, such as sending mail with Cdo.message.

What is Cdo.message? To send a message under Winnt and Win2K to use the Cdonts.newmail,cdonts.newmail component is required to register, very simple, just run the command line on the server regsvr32 Cdonts.dll, OK in the pop-up dialog box, use the Cdonts.newmail service also need to install IIS from the SMTP. To the windows2003, the system is not accompanied by Cdonts.dll files, only a similar file Cdosys.dll, of course, this file in Win2K is also some (need to register components), but 2003 what is the good? The component does not need to be registered manually, and the system is automatically registered. Now let's take a look at how to use the component.

<%
Dim cm
Set cm=server.createobject ("CDO.") Message ")
' Create object
Cm. From= "From@test.com"
' Set the sender's mailbox
Cm. To= "To@test.com"
' Set up a recipient's mailbox
Cm. subject= "I found a website that can subscribe to RSS feeds online, and I don't have to install any more software." "
' Set the subject of the message
' cm. Textbody= "http://www.knowsky.com/rss/"
' Above is the use of ordinary text format to send mail, only text, can not support HTML, so there is no

Cm. htmlbody= "Online RSS Feeds Reader is an on-line RSS news reading system." "&_
"No need to download the installation, as long as you register you can have as powerful as the software RSS online subscription aggregation news system." "&_
"No matter where you are, as long as you can surf the Internet, you can read your favorite subscriptions." "&_
"Sign up now: <a href=http://www.gbmad.net/rss/>http://www.gbmad.net/rss/</a>"

' Above is the HTML body you built, so the message is much better than just text. Don't say you can't do HTML.

' cm. AddAttachment Server.MapPath ("Test.zip")
' If you need to send an attachment, use the above method to attach the file.

Cm. Send
' The last of course was to execute the sent
Set cm=nothing
' Instant release of the object after successful delivery

Response.Write ("The message was sent successfully.) ")
%>



Related Article

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.