Sending an email with asp is fairly easy, all you need is CDONTS (Collaboration Data Objects for NT Server, installed with IIS), or a special component like SMTPmail by SoftArtisans, or AspEmail ( free ) by Persits Software Inc (there are more available).
In this article I'll show how to send emails with CDO, because it's available to everyone and
components work in a very similar way. First we have to create instance of the NewMail object.
The methods and property's of this object are very obvious.
So far it has been pretty easy, hasn't it? There's more.
The first rule defines an attachment ("PATH\TO\FILE", filename_that_appears)
The second rule sends a blind carbon copy The third rule specifies the message's importance
Importance:
0 -> low
1 -> default
2 -> high
Thats it, I hope this article has been useful and i hope that now you will feel confident sending automated newsletters, confirmation emails and so on.
In this article I'll show how to send emails with CDO, because it's available to everyone and
components work in a very similar way. First we have to create instance of the NewMail object.
Code: ASP
<%
Option Explicit
Dim objCDOMail
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
%>
Code: ASP
<%
objCDOMail.To = "somebody@somewhere.com" 'the destination
objCDOMail.From = "me@mydomain.com" 'the sender
objCDOMail.cc = "info@mydomain.com" 'carbon copy
Dim txtBody
txtBody = "This email has been sent by an asp script"
objCDOMail.Subject = "CDONTS" 'the subject
objCDOMail.Body = txtBody 'the body
objCDOMail.Send 'fire off the email
%>
Code: ASP
<%
objCDOMail.AttachFile("c:\wwwroot\mysite\" & _
"MyAttachement.doc", "pricelist.doc")
objCDOMail.Bcc("blind@mysite.com")
objCDOMail.Importance = 1
%>
The second rule sends a blind carbon copy The third rule specifies the message's importance
Importance:
0 -> low
1 -> default
2 -> high
Thats it, I hope this article has been useful and i hope that now you will feel confident sending automated newsletters, confirmation emails and so on.



HASMUKH