ASP Advanced Tutorial X: Message Board Automatic E-Mail

xiaoxiao2021-03-06  62

ASP Advanced Tutorial X: Message Board Automatic E-Mail

The ASP itself does not send mail's ability, but if you want to use ASP to send E-mail (for example: you have a message, just want to let

Those who have left the words on your message know, you hope that the Internet is completed in your message, your message

The book will automatically send the message E-mail to the message, then you need to install an ASP component. And with these components to help you

Automatic send, reply, etc.

If your ASP and Web database running platforms are IIS4 (Internet Information Server 4.0), you can make

Use cdonts.dll. If you have installed NT 4.0 option pack, CDONTS.DLL is stored in your machine.

C: / Winnt / System32 / Directory. With this assembly, we can't apply it immediately, we must

First complete the registration of the component, then how can you register CDONTS.DLL? We can enter in MS-DOS mode

CDONTS.DLL The directory C: / WinNT / System32 / Under Enter: C: / Winnt / System32> Regsvr32 CDONTS.DLL (if we want to use its Royal Directive: C: / Winnt / System32> Regsvr32 / U CDONTS. DLL)

After completing the registration of the component, now we can start to explain how to use the components. We can use the following simple

The script came to add automatic E-mail to the message book.

<% Dim MailObject Dim Email Email = Request.form ( "Email") Set MailObject = Server.CreateObject ( "CDONTS.NewMail") Set myMail = Server.CreateObject ( "CDONTS.NewMail") myMail.Subject = "Welcome to the next "MailObject.send" You I'm e-mail ", email," Welcome to us next time. "MyMail.send set mymail = nothing%> Put the above code COPY to manage2.asp, a simple The message book through the ASP to send E-mail is achieved. and also

You will not satisfy this way of e-mail, the reason is very simple: because in order to thank your netizens to your support, you have been

After a few thousand words (maybe I said less), I got up early in this morning, I found out that the above message book is actually.

There is a function of the attachment,, this is more gas. Fortunately, the original cdonts.dll can also be used to send attachments, things are not suitable

We immediately dedicate it. <% Dim MailObject Dim Email Email = Request ( "Email") Set MailObject = Server.CreateObject ( "CDONTS.NewMail") att_file = "D: /cwj/GO-asp/guestbook5/email.txt" f_name = "email. TXT "MailObject.from =" You my own e-mail "mailobject.to = email mailibject.subject =" Thank you for your support "MailObject.body =" Thank you for your support "MailObject.attachfile att_file, f_name mailObject.send%> Just use the code COPY to replace the first instance, our message book can implement automatic accessory functionality. in

It is worth noting here: att_file = "d: /cwj/go-asp/guestbook5/email.txt" must be the absolute path to our accessories. In fact, in addition to cdonts.dll components, there are many components developed by third-party manufacturers.

can use. For example, Intel is also said to include Aspmail components and seems to be very popular with W3 JMAIL. Can

When you are welcome, the Central Plains is not sentenced by them, we can download them directly from the following place. Aspmail component download address http://www.flicks.com/aspmail/intro.htm jmail Component's download address http://download.dimac.net/jmail/jmail.exe

Speaking of actual, my first component used by the ASP to send E-mail's message book is an ASPMAIL component (naturally because

I heard that Intel is also using it. Since I have used it, I naturally understand it, I think it is also right.

A simple introduction is made asPmail components.

The way to apply the ASPMAIL component is also very simple. First we have to install the component first, after installation is completed

ASPMAIL installation directory will accompany the Sample instance, and we will change it by controlling these examples. I am here

Provide an instance to everyone, and separate all other files involved in this component alone in the ASPMAIL directory

Everyone can download after downloading area, I only make a simple description here. First, we entered and save

Manage3.asp, and the Script of the specific sendmail2.asp is as follows: <% set mailer = server.createObject ("aspmail.aspmailctrl.1)%> <% name = request.form (" name ") email = Request. Form ("email") Subject = "Welcome to" MEMO = "next time!" MailServer = "SMTP.21CN.com" Result = mailer.sendmail (Mail Server, Name, Email, Subject, Memo )%> Here everyone is: mailserver = "smtp.21cn.com" is filled in the SMTP server, I have used the 21st century SMTP mail server to make an example, of course you can use other places. Or yourself (really envious of people)

), It is very important, you have to fill in the correct, and it is true that they are indeed open. As for my last

And give up the use of this component. After you have used it, it is likely that I will not be a few, the reason is very simple: because of this free

The component will hate a few sentences in each letter you sent.

转载请注明原文地址:https://www.9cbs.com/read-90340.html

New Post(0)