ASP Tip: Sending mail with CDONTS object
IIS 4.0 and above has a very useful server object: CDONTS. Using this it is possible to send e-mails from your ASP code (VBScript) very easily. Here you have an example of how to do this.
The Object (CDONTS.NewMail) has several properties and methods that you must know:
| .From |
E-mail address of the sender |
| .To |
E-mail address of the recipient |
| .CC |
CC recipient e-mail address |
| .Subject |
Subject of the message |
| .Importance |
Importance of the message:
0=Low
1=Normal (default)
2=High |
| .BodyFormat |
Format of the message
0=Text (default)
1=HTML |
| .Value(Name) |
New header |
| .Body |
Body of the message |
| .AttachFile |
Attaches a file (it is needed to indicate the real path,
not the web path of the file) |
| .Send |
Calling this method the message is sent |
Download a code example sending a text message and using several of the properties listed above.
I hope you foud this useful!
Related articles:
Sending mail with CDOSYS object.
Author: Carlos Baez
You can also submit your own code examples. Just e-mail them.
Read the disclaimer.
|