In fact, ASP can do many things, but people don't know how to use them. Microsoft provides a lot of ready-made and useful components for ASP, but no one knows about these components, such as using CDO.Message to send emails.
What is CDO.Message? To send emails under winnt and win2k, you need to use CDONTS.NewMail. The CDONTS.NewMail component needs to be registered. It is very simple. Just run the command line regsvr32 Cdonts.dll on the server and confirm in the pop-up dialog box. Use CDONTS. The NewMail service also needs to have the smtp that comes with iis installed. With Windows 2003, the system no longer comes with the Cdonts.dll file, leaving only a similar file cdosys.dll. Of course, this file is also available in win2k (requires component registration), but what is good in 2003? This component does not need to be registered manually, the system has automatically registered it. Now let's see how to use this component.
<%
Dim cm
Set cm=Server.CreateObject("CDO.Message")
'Create object
cm.From=" [email protected] "
'Set the sender's email address
cm.To=" [email protected] "
'Set the recipient's email address
cm.Subject="I found a website that allows you to subscribe to RSS online. No need to install any software in the future."
'Set the subject of the email
'cm.TextBody=" http://www.downcodes.com/rss/ "
'The above uses ordinary text format to send emails. It can only be text and cannot support html, so it is not used here.
cm.HtmlBody="Online RSS Feeds Reader is an online RSS news reading system."&_
"There is no need to download and install. As long as you register, you can have an RSS online subscription and news aggregation system that is as powerful as the software."&_
"No matter where you are, as long as you have Internet access, you can read your favorite subscriptions."&_
"Hurry up and register: <a href=http://www.gbmad.net/rss/>http://www.gbmad.net/rss/</a>"
'The above is the HTML text you constructed, like this The emails you send out look much better than those with just text. Don't say you don't know html'cm.AddAttachment
Server.MapPath("test.zip")
'If you need to send an attachment, use the above method to attach the file.
cm.Send
'Finally, of course, execute the send
Set cm=Nothing
'Release the object immediately after sending successfully
Response.Write("Send email successfully.")
%>