Howto send E-mail from an ASP page

This article will show you how simple it can be to send an e-mail from an ASP page. With just a few lines of code, you can add mail sending capabilities to your ASP page in your Web site. Notice that I put the focus on can be; depending on your network setup, this approach may be very easy, or it may require you to setup or configure your network for this code to work. See the reference section at the end of this document for more information.

There are basically two ways to send an e-mail from your Web page: either from the client, or from the server. The client side method (using mailto: in either a <a href> tag or in a <form> tag) has quite a lot of disadvantages: first of all, it requires a working e-mail application at the client. Second, and more importantly, it requires your user to actually confirm and send the message themselves.

So, in most real-world applications, sending an e-mail from server side code is the way to go. Fortunately, sending e-mail from an ASP page is not that difficult. This article discusses two ways to send the e-mail: using the CDONTS.NewMail object and using the CDO.Message object. The first solution will work on most modern Windows installations (2000 and up), but it requires a local SMTP Server (running on the same machine that server the ASP pages) to relay the message. The second solution uses a remote SMTP server so there is no need for a local SMTP Server. However, you'll need to have the Collaboration Data Objects for Microsoft Windows 2000 or for Microsoft Exchange installed. These objects come with recent Microsoft Office installations (2000 and up, as far as I know. You usually find this option under Microsoft Outlook) and other Microsoft products. This solution can therefore also run on platforms that don't support a local SMTP Server, like Windows XP Home Edition.

Using CDONTS.NewMail to Send, uh, New Mail

As I said before, using the CDONTS.NewMail object requires you to have a local SMTP Server installed. This server comes with IIS so there is a good chance you have it already up and running. (As of Windows Server 2003, the SMTP Server is no longer installed by default). The reference section at the end of this article contains a link to a Microsoft article detailing the setup procedure for the SMTP Server.

Once you have the SMTP Server up and running, it's time to code. With the next 4 steps, I'll show you how to create an HTML form that allows a user to enter their name and a personal message. On the click of a button, the form will be submitted to the server and the form's contents are e-mailed to an e-mail address you specify.

  1. Create a new ASP page and call it SendMail.asp. If you're not using an advanced IDE, like Dreamweaver MX, but Notepad for example, add the default tags that are required for an HTML page, like the <html>, <head> and <body> tags.
  2. Between the <body> tags, add the following code:

      <form id="frmSendEmail" method="post" action="SendMail.asp">
        Your name: <input type="text" name="txtName" id="txtName" /><br />
        Your message: <textarea name="txtMessage" id="txtMessage" cols="40"
             rows="10"></textarea><br />
        <input type="submit" name="btnSubmit" id="btnSubmit"
              value="Send Message" />

  3. At the top of your page, right before the opening <html> tag, add this ASP code:

      If Request.Form("btnSubmit") <> "" Then
        Dim UserName
        Dim UserMessage
        UserName = Request.Form("txtName")
        UserMessage = Request.Form("txtMessage")     
        Dim Message
        Message = "Mail from the Web site" & vbCrlf & vbCrLf
        Message = Message & "User " & UserName & _
             " left the following message: " & vbCrLf
        Message = Message & UserMessage & vbCrLf & vbCrLf     

        Dim oMessage
        Set oMessage = Server.CreateObject("CDONTS.NewMail")

        Const CdoBodyFormatHTML = 0 ' Send HTML Mail
        Const CdoBodyFormatText = 1 ' Send Text Mail

        Const CdoMailFormatMime = 0 ' Send mail in MIME format.
        Const CdoMailFormatText = 1 ' Send mail in uninterrupted
                                    ' plain text (default value).

        With oMessage
          .To = "You@YourProvider.Com"
          .Bcc = "SomeoneElse@YourProvider.Com"
          .From = "YourWebsite@YourProvider.Com"
          .Subject = "User " & UserName & " left a message"
          .BodyFormat = CdoBodyFormatText ' CdoBodyFormatHTML
          .MailFormat = CdoMailFormatMime ' CdoMailFormatText
          .Body = Message
        End with
        Set oMessage = Nothing

      End If

  4. That's all there is to it. Save the page, and request it in your browser. Type your name and a message and then hit the Send Message button. If everything worked as planned, you'll receive an e-mail with your name and the message you typed in.

How It Works

Once the form has been submitted to the server, the values for the user's name and message are stored in two variables. Then a new object of type CDONTS.NewMail is created. For this object to work properly, you need to se t a few properties, like the To field, the Subject and the Body. In this example, I also set a BCC field. Note that you should change the e-mail addresses in the code to valid addresses. I highlighted the areas you need to change. When the message object is created, it can be send with (take a wild guess....) the Send method.

For this example, I have set the BodyFormat to CdoBodyFormatText. This will send the e-mail as plain text. With plain text, you need the ASP (VBScript) constant vbCrLf to add a line break to your message. If you have set the BodyFormat to CdoBodyFormatHTML you can use HTML to format your message. You can use the <br / > tag for a line break, but you can also add headings, links and even form elements.

The Send method tries to send the message to a local SMTP server. If it can't find one, the code will fail. Once the message has been sent successfully, the user is redirected to a ThankYou page where you can express your eternal thanks (and display a few of your revenue-generating banner ads along the way).

Using the Collaboration Data Objects to Send E-mail

Sending e-mail with the Collaboration Data Objects is pretty similar. Once you have installed the Collaboration Data Objects, you're ready to send e-mail from your ASP page. Note that the first two steps are exactly the same as in the previous solution. This is just an easy way to make this article look much more impressive than it really is. You can even print it out and drop it somewhere on your desk to impress your colleagues. Anyway, back to business. Follow the next 4 steps to add e-mailing capabilities to your ASP page:

  1. Create a new ASP page and call it SendMail.asp. If you're not using an advanced IDE, like Dreamweaver MX, but Notepad for example, add the default tags that are required for an HTML page, like the <html>, <head> and <body> tags.
  2. Between the <body> tags, add the following code:

      <form id="frmSendEmail" method="post" action="SendMail.asp">
        Your name: <input type="text" name="txtName" id="txtName" /><br />
        Your message: <textarea name="txtMessage" id="txtMessage" cols="40"
                    rows="10"></textarea><br />
        <input type="submit" name="btnSubmit" id="btnSubmit"
              value="Send Message" />
  3. At the top of your page, right before the opening <html> tag, add the following ASP code. The code comes pretty much directly from the Microsoft MSDN site. You'll find a link to the original article in the References section at the end of this article.

    If Request.Form("btnSubmit") <> "" Then
      Dim UserName
      Dim UserMessage
      UserName = Request.Form("txtName")
      UserMessage = Request.Form("txtMessage")
      Dim Message
      Message = "Mail from the Web site" & vbCrlf & vbCrLf
      Message = Message & "User " & UserName & _
           " left the following message: " & vbCrLf
      Message = Message & UserMessage & vbCrLf & vbCrLf
      Const cdoSendUsingPort = 2

      Dim oConfiguration
      Dim oMessage
      Dim oFields
      Set oMessage = CreateObject("CDO.Message")
      Set oConfiguration = CreateObject("CDO.Configuration")

      Set oFields = oConfiguration.Fields
      ' Set the CDOSYS configuration fields to use port
      ' 25 on the SMTP server.
      With oFields
      .Item("") _
          = cdoSendUsingPort
      .Item("") _
          = "SMTP.YourProvider.Com"
      .Item("") _
          = 10
      End With

      ' Apply the settings to the message.
      With oMessage
        Set .Configuration = oConfiguration
        .To = "You@YourProvider.Com"
        .Bcc = "SomeoneElse@YourProvider.Com"
        .From = "YourWebsite@YourProvider.Com"
        .Subject = "User " & UserName & " left a message"
        .HTMLBody = Message
      End With

      ' Clean up variables.
      Set oMessage = Nothing
      Set oConfiguration = Nothing
      Set oFields = Nothing

    End If

  4. Again, that's all there is to it. Save the page, and request it in your browser. Type your name and a message and then hit the Send Message button. If everything worked as planned, you'll receive an e-mail with your name and the message you typed in.

How It Works

Just as with the previous example, the form's contents are retrieved and stored in variables. Instead of the CDONTS.NewMail object, an object of type CDO.Message is constructed. This object has a Configuration property that allows you to change stuff like the SMTP Server that will send the e-mail message for you. In this example, I have set the SMTP Server to SMTP.YourProvider.Com. Obviously, you need to change it to the name of your SMTP Server.

The rest of the code is very similar to the example with the CDONTS.NewMail object: the To, BCC and From addresses are set (again, make sure you change them to more reasonable addresses). Also, the Subject and the Body are set. The Send method will deliver the message to the SMTP Server you specified in the configuration fields. This SMTP Server will then take care of sending the message to your recipient(s).


Sending e-mail from ASP pages is pretty easy. Once you have your network setup and configured correctly, you do not need much code to send an e-mail. This article has shown you two ways to send the e-mail; using CDONTS and using the Collaboration Data Objects. Which methods works best for you depends on your network setup. If you have an SMTP Server installed on the machine running your ASP pages, you can use the CDONTS method, otherwise you need to use the Collaboration Data Objects solution.


Download Files

Where to Next?

Wonder where to go next? You can read existing comments below or you can post a comment yourself on this article .

Consider making a donation
Please consider making a donation using PayPal. Your donation helps me to pay the bills so I can keep running Imar.Spaanjaars.Com, providing fresh content as often as possible.

Feedback by Other Visitors of Imar.Spaanjaars.Com

On Monday, February 28, 2005 4:40:32 PM Brenda Malone said:
Using ASPMail, CDO, I am creating a "forgot password" page. On the form is just one field for the "user email". My SQL query looks up to confirm a valid member and returns the results. I have been struggling for a week on exactly how to pull the results of the Query (not the form) in order to send the user an email with his/her username and password (variables which are returned with the query.)

I know this is probably very easy for you guys. But I am just a graphic designer who was told to do this dynamic website without any instruction.

I am using DW MX 2004, MS SQL, ASP VBscript on a hosted server.

Thanks to all for your help!!
On Monday, February 28, 2005 8:40:39 PM Imar Spaanjaars said:
It all depends on your query and database structure, but you probably need to add the EmailAddress and Password to your select statement, and then get it from the recordset like this:

Dim password
password = MyRecordset.Fields("Password").Value

For a detailed answer, I suggest you to post this question on a forum like

These forums are there for exactly these kind of questions....

On Monday, March 21, 2005 5:23:54 PM Ulrich Alain said:
Hei again :)

I have problems sending e-mail from my application.

I am using a local server IIS on Windows XP pro. and Visual Studio.Net 2003. When I try to run the code, I get this message:

" System.Web.HttpException" occured in system.web.dll.
could not access ' CDO.Message ' object.

and the error is pointing on SmtpMail.Send(notificationMail)

Here are the codes:

In Orderprocessor.vb file:

Friend Sub MailAdmin(ByVal subject As String, ByVal message As String, _
                         ByVal sourceStage As Integer)
        ' Send mail to administrator
        SmtpMail.SmtpServer = Configuration.MailServer
        Dim notificationMail As MailMessage = New MailMessage
        notificationMail.To = Configuration.AdminEmail
        notificationMail.From = Configuration.OrderProcessorEmail
        notificationMail.Subject = subject
        notificationMail.Body = "Message: " & message & Chr(10) & "Source: " _
                             & sourceStage.ToString() & Chr(10) & "Order ID: " _
                                & OrderID.ToString()
    End Sub

in Module.vb file:

Sub Main()

        Dim configuration As OrderProcessorConfiguration = _
          New OrderProcessorConfiguration( _
           "Server=(local)\NetSDK;Integrated Security=True;Initial Catalog=AfroShop", _
           "MailServer", _
           "", _
          "", _
            "", _
        Dim processor As New OrderProcessor
        ' processor.Process(ByVal orderID As Integer, ByVal configuration As
        ' OrderProcessorConfiguration)
        processor.Process(1, configuration)
    End Sub

I have used Imports System.Web.Mail

How can I solved this problem? I have tried to used:

regsvr32 cdosys.dll

on my Visual Studio.Net prompt commande, but the return error message were:

" DllRegister Server in cdosys.dll failed return code was:0x800704da "

Thank you for your support!
On Monday, March 21, 2005 6:21:23 PM Imar Spaanjaars said:
What does Configuration.MailServer contain?

Are you sending your e-mail to a mail server your development machine can reach, and is allowed to relay to?

On Tuesday, March 22, 2005 1:57:49 PM Ulrich Alain said:
I am not sure, I also doubt on that.

I am sending an e-mail to my own e-mail adress:
"" and from ""(which is just fictive), but I have tried with both my e-mail:

from "" to "" and I got the same result.

One positiv thing is that the audit table register the date and time.

I also realise that my Outlook Express is not sending messages from my computer. Do you know why?

error result:

The host 'SMTP' could not be found. Please verify that you have entered the server name correctly. Account: 'IMAP', Server: 'SMTP', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 11001, Error Number: 0x800CCC0D
On Wednesday, March 23, 2005 7:33:44 PM Imar Spaanjaars said:
This is getting a bit too technical to discuss as a comment on this article. Can you please visit and post your question there?


On Tuesday, May 17, 2005 4:03:30 PM bashir said:
Hi Imar,
u'r article is very helpful, however, it doesn't asnwer the question; what if someone want to send the results of the recordset using URL parametrized query.
for instance,
list.asp is list records from database
emailForm.asp is using paramtrized query from list.asp
u clicked on send buttom and invoked methods of sendForm.asp using CDONTS.  how do u accomplish something in that nature. just feedback will help.
On Wednesday, May 18, 2005 6:15:54 AM Imar Spaanjaars said:
Hi bashir,

I am not sure I understand what you're asking. Do you mean sending out multiple emails based on data in a recordsset?

On Thursday, December 01, 2005 9:48:21 PM Thi Nguyen said:

I followed your article, and was able to send myself the homepage of and it's real cool. I then tried it on my project and I have no idea on how to proceed.

I have a simple "form.htm" with just a Name field. Using asp and html code, I get an output page named "form_filled.asp" that looks identical to form.htm. How do I send this output to an email message? Thanks

Thi Nguyen
On Thursday, December 01, 2005 10:27:02 PM Imar Spaanjaars said:
Hi there,

I don't think I quite understand what you're asking here.

Can you rephrase your question a bit and, even better, post it at If you post the link here, I'll take a look.


On Thursday, December 15, 2005 1:33:36 PM Shafik said:
I am sending the mail by using SMPT ,The code is developed in VC++ (CDO). My question is,I Am Sending the Mail by using the send function,but the mail is not delivered  to the receipient .still i am not getting the any error or notification of mail is deliverd or not.
1) How i can get the Notification of mail delivered  through the code wihout going the Outlook express.
Please send it is  urgent
On Thursday, January 12, 2006 9:52:27 AM Prasenjit Saha said:
I want to know ,how I track the user of my site use the link of third party to that site and insert some data successfully.
How do I know that the user successfully enter all the data in third party database.Note ,I have no collaboration with the third party site.
On Friday, January 13, 2006 7:34:55 PM Imar Spaanjaars said:
Hi Prasenjit Saha,

How do you see the relation between your request and the topic of this article: sending e-mail with ASP"??

On Thursday, February 16, 2006 9:48:47 PM Peter Parry said:
When I try to run  CDONTS and press Submit the Sendmail.asp code some up on the sceen in VB and I am asked to Save. It will not save because it has the same name as the open file. How do I prevent this happening and get the form to submt  and send to my email address without the asp code coming up?

On Saturday, February 18, 2006 1:28:58 AM Imar Spaanjaars said:
Hi Peter,

I am not sure what you mean. Do you get a Save As dialog in the browser? If so, make sure you open the file over http (e.g. http://localhost/SendMail.asp) and not as a normal file.


On Tuesday, February 21, 2006 7:14:54 PM Antony said:
Good day, Imar.
Any suggestions on how to check whether a message sent using CDO/CDONTS component has arrived to the Reciever?
Or should I search for other server-side email messaging COM components?
On Tuesday, February 21, 2006 8:47:54 PM Imar Spaanjaars said:
Hi Antony,

Yeah, I think so, but I am not even sure that is possible.

The problem witb e-mail is that you just don't know. A message can bounce (easy to discover by looking at the repl-to's e-mial box), arrive at the destination, or be "put on hold" by an intermediate server.

I don't think there's a straight way to discover a mesage has been received or not. You can ask for a "receipt confirmation" when you send en e-mail, but I guess most people click No when asked to send that confirmation.

What is it that you're building that requires this functionality? Is e-mail the best route to take?

On Wednesday, February 22, 2006 11:15:32 AM Antony said:
Hello again
Yes, I've looked at the problem from another POV and I think I've found a simplier way of coping with the original problem.
Though, I'm still curious if there is a mail transfer protocol (and its implementation) that allows to programmatically check whether mail arrived to destination server and whether Reciever email address really exists. I mean like in this piece of pseudocode:

function mailRoutine(){
  Mail mail = new Mail();
  mail.from = ""; = "";
  mail.body = "This is a body of email message";
    if (e.description=="No receiver registered at domain")
// do smth
    if (e.description=="Domain not exists:")
// do smth
  println("Mail successfully delivered to ''");
On Wednesday, February 22, 2006 7:23:04 PM Imar Spaanjaars said:
Hi Antony,

That would only partially work. If you send this e-mail to an SMTP server that uses a drop folder or some queueing mechanism, the server says "thank you" and no exception is raised. Afterwards, the server tries to deliver the message which might fail. So, you can't be sure the message gets delivered or not.

If you want to find out if an e-mail address exists, look into third party components that can do this. However those check whether the address exists, and not really whether a message is delivered or not.

On Saturday, April 15, 2006 8:04:53 AM swaroop said:
How to send mail without using CDONTS and CDO
using Outlok
On Wednesday, April 19, 2006 6:52:35 AM Imar Spaanjaars said:
Hi swaroop,

Start Outlook, choose File | New Mail Message, type in a To address, a Subject and a Message and then hit the Send button ;-)

A bit more serious: this is a bit hard to explain as a comment on an article and is not really related to the article itself. I suggest you post your question at and provide more information about what exactly you're trying to accomplish.


On Friday, July 07, 2006 11:14:32 AM sam said:
Hello sir/Madam

I want to send mail from localhost to my yahoo account. my computer is internet ready. is it possible through SMPT. if you have any code to solve this problem then let me know.

On Friday, July 14, 2006 6:38:43 PM Imar Spaanjaars said:
Hi Sam,

I could be very thick today, but isn't this whole article about sending mail from your local machine to somewhere on the Internet?

Confused.... ;-)

On Saturday, September 23, 2006 4:06:11 AM Michael said:
Ok, I'm not using ASP or SQL but DW MX. Basic HTML page, and I'm struggling to set up sending the form to myself.

Noting happend, I can do the pop up saying thanks, and redirecting to my homepage, but no email.

Any ideas?
On Saturday, September 23, 2006 9:24:00 AM Imar Spaanjaars said:
Hi Michael,

You'll need a server side technology to submit an e-mail from a web page. Plain HTML doesn't allow you to do this.

The only alternative is to set the form's action attribute to This way, the end user's mail client is used to send out an e-mail. A far from ideal solution though...


On Thursday, October 26, 2006 1:32:28 PM Michael Riordan said:
I am trying to send and receive e-mail on a standalone PC(with no internet connection) in order to test a basic form that I created with Dreamweaver and ASP. However Outlook Express doesnt receive any mail that I send to myself. How do I get around this? I have IIS installed and running as well as SMTP. Is there a specific way to configure either them or Outlook Express(my default mail application)? I would appreciate help on this - I just want to be able to see an email enter into my inbox from the form.
On Thursday, October 26, 2006 8:12:49 PM Imar Spaanjaars said:
Hi Michael,

I don't think you can. SMTP servers are used to send out e-mail, not receive it. So, you either need an Internet connection and send the mesaage to your provider's mail server, or install a POP server locally so Outlook can pop the message from that server.


On Thursday, February 01, 2007 11:39:02 AM yamini said:
i need a clear coding in writing the code in vb..
if i enter the details in the form those details should be sent to mail id in a button click event
On Thursday, February 01, 2007 11:46:25 AM Imar Spaanjaars said:
Hi yamini,

On this site, there's only a C# version of a .NET 1.x article:

Google will give you VB versions of similar articles as well....

On Saturday, March 31, 2007 5:33:02 AM amit said:
I want to send mass emails using ASP.

Please suggest me appropriate way so as to send mail to 2000 users one by one i.
On Wednesday, May 02, 2007 10:53:45 AM keith Walker said:
I am using the following code to send an email but would like to format it with commands other than vbcrlf, is it possible to add tables and bold text etc ?

Is there anywhere I could find a list of usable commands ?

the subjectstr = subjectstr & namestr
        'Form the main body of the email
        bodystr = bodystr & vbcrlf & vbcrlf & "Name: " & namestr & vbcrlf & vbcrlf
        bodystr = bodystr & "Directorate / Branch: " & directoratestr & vbcrlf & vbcrlf
        bodystr = bodystr & "Branch Record Manager: " & recordmanagerstr & vbcrlf & vbcrlf
        bodystr = bodystr & "Approved: " & vbcrlf & vbcrlf & vbcrlf
        bodystr = bodystr & "Retention Schedule Applied: " & vbcrlf & vbcrlf
        bodystr = bodystr & "End user Notification: " & vbcrlf & vbcrlf
        bodystr = bodystr & "Date: " & vbcrlf & vbcrlf & vbcrlf
        bodystr = bodystr & "-------------------------" & vbcrlf & vbcrlf & vbcrlf
        bodystr = bodystr & "Rejected: " & vbcrlf & vbcrlf & vbcrlf
        bodystr = bodystr & "Reason: " & vbcrlf & vbcrlf
        bodystr = bodystr & "End user Notification: " & vbcrlf & vbcrlf
        bodystr = bodystr & "Date: " & vbcrlf & vbcrlf
    Dim iMsg
    Dim iConf
    Dim Flds
    Const cdoSendUsingPort = 2
    Const strSmartHost = "mail server"

    'Create the message object.
    Set iMsg = CreateObject("CDO.Message")

    'Create the configuration object.
    Set iConf = iMsg.Configuration

    'Set the fields of the configuration object to send by using SMTP through port 25.
    With iConf.Fields
       .item("") = cdoSendUsingPort
       .item("") = strSmartHost
    End With

    'Set the To, From, Subject, and Body properties of the message.
    With iMsg
.To = toAddress
.From = fromAddress
.Subject = subjectstr
.TextBody = bodystr
    End With
    set iMsg = Nothing
On Wednesday, May 02, 2007 11:04:25 AM Imar Spaanjaars said:
Hi keith,

You can send the mail with HTML formatting. That way, you can use pretty much the tags and formatting you can use in plain HTML / CSS.


On Wednesday, May 02, 2007 11:35:49 AM Keith said:
Thanks for getting back to me so quickly, do I need to edit the code to allow me to use HTML formatting ?

Also if the recipient has his mail format set to rich or plain text will it still be displayed as required ?
On Wednesday, May 02, 2007 12:01:29 PM Imar Spaanjaars said:
Hi Keith,

You can set HTMLBody and TextBody at the same time. Clients will then display the appropriate format.

Search Google for CDO.Message HTML and you'll find some interesting stuff.

On Wednesday, September 26, 2007 4:47:00 PM Jithu said:
Can u suggest me a way to send the mail on a scheduled date through asp.
On Wednesday, September 26, 2007 6:13:28 PM Imar Spaanjaars said:
Hi Jithu,

Searching Google for the terms you mentioned should bring up some useful articles.


On Friday, March 28, 2008 12:44:37 PM anshul said:
I'm using CDOSYS.dll on my ASP page to send e-mail and SMTP virtual
server is running on my computer. After i send a email to someone to
someone@xxxxxxxxx for example, the email is sent to spam folder when i
check the @ address.
I'm using following code : ...

<snip>Code cut by Imar</snip>

I want to send a email to a inbox folder of someone@xxxxxxxxx
How do I execute this task, help me please!!!
Any suggestion will be appreciated!
On Friday, March 28, 2008 10:25:09 PM Imar Spaanjaars said:
Hi anshul,

Spam is a client or mail server issue, and doesn't have anything to do with the code you use to send the e-mail.

You need to check the contents of your message, the intermediate mail servers and the sender of the messages, as they impact how your message is qualified: spam or no spam.

On Sunday, April 06, 2008 4:59:01 PM Fran said:
Hey everryone! I'm using Dreamweaver cs3 to build my website but I can't find anywhere to put the codes. I have created a button to accept a form (with name/email and comments of the site's visitors) but I can't put it to work. I think I have to write, in the form action, but from here I don't know... Can anyone help me?
On Sunday, April 06, 2008 5:40:20 PM Imar Spaanjaars said:
Hi Fran,

mailto triggers a client's mail application, which may not always be good enough.
To send mail from within your application you need a server side technology like ASP or ASP.NET, as shown in this article. Dreamweaver supports a few technologies as well (ASP, PHP, a bit of ASP.NET) but you need the right setup on the web server as well.

You could take a look at my book Beginning Dreamweaver MX 2004 for some ideas on this.


On Wednesday, August 13, 2008 8:16:19 AM jess said:
please help. I have been using a simple form template in ASP for contact sections for websites and so far i have had no problems with it. Recently i tested the same form running on a different server and once I hit the Submit button, instead of leading me to the "Thank you for taking the time to fill up this form " page, it leads to the sendmail.asp page with all the codings on the browser and no emails notifications sent to my email as well.i dont understand. I have uploaded all the files correctly to the server. Please help
On Thursday, August 21, 2008 8:27:02 AM Imar Spaanjaars said:
Hi jess,

Sounds like your server is not configured to handle the ASP file extension.

You should talk to your server admin to get that fixed.


On Tuesday, September 17, 2013 10:25:27 AM vbv said:
here is another post i found to be useful. hope it helps.
On Saturday, January 18, 2014 11:18:43 AM jayanthi said:
i have code for send message to user mail id at the time of button click
On Friday, May 22, 2015 5:33:36 AM Fathima said:
I am using CDOSYS to send mails.
I want to send email to the user by fetching his email address from the database i.e stored in result set (rs_user("Email").
could you tell me the syntax for it.

If i am using the specific mail address i am able to send the mail but if i want to fetch the mail address from the result set then its throwing error.

sqlString = "SELECT * FROM UserDB WHERE ID = " & CStr(rs("Approval"))
rs_User.Open sqlString, objConn
if not rs_user.eof then
ApprovedBy = rs_User("FirstName") & " " & rs_User("LastName")

ApprovalByEMail = rs_User("EMail")

With objCDOSYSMail

Set objCDOSYSMail = Server.CreateObject("CDO.Message")

.From = ""

'Who the e-mail is sent to
.To = ""

'Carbon Copy

.Subject = "Testing123"

.HTMLBody = "Email for Testing Purpose."


End with

Set objCDOSYSMail = Nothing

Please help me its pretty urgent..

Thanks inadvance.

On Friday, May 22, 2015 8:10:48 AM Imar Spaanjaars said:
Hi Fathima,

Not sure what you're asking or need help with. Aren't you just looking for this:

.To =  rs_User("EMail")


On Tuesday, May 26, 2015 4:57:08 AM Fathima said:

I am using persist software to send mails.

below is the code:

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = ""
                                 Mail.From = ""
Mail.AddAddress= ""

Mail.Body = htmltxt
'Mail.IsHTML = True
On Error Resume Next
If Err <> 0 Then Response.Write "Error encountered: " & Err.Description

My question is " Is it possible to use CDOSYS  for sending mail in my code"

Do i need to install any software for it using CDOSYS im my server.

Please assist me.

Thank you in advance.
On Tuesday, May 26, 2015 7:23:31 AM Imar Spaanjaars said:
You could, but why bother when you already have access to Persits. That component is typically easier to use and has more features.


On Tuesday, May 26, 2015 9:02:48 AM Fathima said:

Yah Imar, but unfortunately we are using free version of ASP. So SMTP authentication will not work :(

So we are going now to CDOSYS method.. using this method instead of hardcoding email id..can we pass the email id dynamically from result set ?

Please help with the syntax.
On Tuesday, May 26, 2015 6:19:42 PM Imar Spaanjaars said:
Yes, didn't we discuss this before?

.To =  rs_User("EMail")

On Friday, December 09, 2016 5:28:12 PM Trent said:
Great style of explaining %BT%. That’s exactly what I want.
Wouldn’t you mind if I apply certain of this knowledge inside
my school powerpoint presentation? Or might be
I will purchase document from website in this overview on Irene

Talk Back! Comment on Imar.Spaanjaars.Com

I am interested in what you have to say about this article. Feel free to post any comments, remarks or questions you may have about this article. The Talk Back feature is not meant for technical questions that are not directly related to this article. So, a post like "Hey, can you tell me how I can upload files to a MySQL database in PHP?" is likely to be removed. Also spam and unrealistic job offers will be deleted immediately.

When you post a comment, you have to provide your name and the comment. Your e-mail address is optional and you only need to provide it if you want me to contact you. It will not be displayed along with your comment. I got sick and tired of the comment spam I was receiving, so I have protected this page with a simple calculation exercise. This means that if you want to leave a comment, you'll need to complete the calculation before you hit the Post Comment button.

If you want to object to a comment made by another visitor, be sure to contact me and I'll look into it ASAP. Don't forget to mention the page link, or the QuickDocId of the document.

For more information about the Talk Back feature, check out this news item.