How To Create A Contact Form In Dreamweaver CS3 Using ASP
On the back of my tutorial on How Create a Working Contact Form In Dreamweaver CS3 which used PHP. There have been a few requests from readers here at Dreamweaver Spot if I could provide an article on How To Create A Contact Form in Dreamweaver using ASP. So for all you people that have sites hosted on a server that has ASP Support then you will find this article of great use.
There are quite a few of these around but I found, especially when I was looking at this that most of them are very hard to configure and follow. So I have written this in an easy to follow way. You can download the files for this Article from Heres.
NOTE: This form does not have any Form Validation as yet. This is the Topic of an upcoming article so make sure you Subscribe To The RSS Feed so you don’t miss it.
Step 1. Setup the Contact Form
Create a New Page in Dreamweaver. File > New > Blank Page > HTML > Create. Insert a Form. So From the Insert Menu Select Form.

From the Form Dialog Box that pops up give the Form an action of contact_us.asp (this will be the name of the page that we send this info to to process it and send you an email). Also change the Method to Post.

Now Using a combination of Labels and Text Boxes and a Text Area Layout the Form the way you would like it. In this example I have placed the Labels directly above the Input Boxes for useability purposes. I have also used a field set to group the elements together. If you need to know more about styling web forms with CSS then read this article.
Now when you are placing the Text Boxes and the Text Area on the page make sure that you give them the following names:
FirstName, Surname, Email, Website, Message. This is very very important as the ASP Script that I will be using will require these names.
To make it really simple. The text box that you are using for the users first name give it a name FirstName etc etc. You get the drift. In this Article I am not going to go into to much detail about using css to style the form and its elements you can check out how do do that here. You can see my simple form below.

Now that we have a simple Contact Form set up let’s move onto to the important stuff, the ASP Page that will handle the form processing.
Step 2. Create the ASP Page to Handle The Form and Send You an Email
In Dreamweaver, create a new ASP Page. File > New > Blank Page > ASP VBscript. Save this page as contact_us.asp and into the same location as the Form Page you created earlier.
Copy the ASP Code Below and Paste it in between the tags of the ASP Page.
<%
Const cdoSendUsingMethod = _
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = _
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = _
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = _
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = _
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = _
"http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = _
"http://schemas.microsoft.com/cdo/configuration/sendpassword"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Dim FirstName, Surname, Email, Website, Message
FirstName = Request.Form("FirstName")
Surname = Request.Form("Surname")
Email = Request.Form("Email")
Website = Request.Form("Website")
Message = Request.Form("Message")
' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "< Enter SMTP Server Name Here >"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "< Enter SMTP Server Username >"
.Item(cdoSendPassword) = "< Enter SMTP Server Password >"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = "< Email Address That The Email Will Be Sent To >"
.From = "< Email Address That The Email Will Be Sent FROM >"
.Subject = "SMTP Relay Test"
.TextBody = "SMTP Relay Test Sent @ " & Now()
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>
Now what you will need to do is change the values of the lines that I have highlighted in RED. Enter the name of your SMTP Server (eg: mail.yourdomain.com), SMTP Username (if your server requires authentication, which most do) and also your SMTP Password.
Just Check Your POP3 Account Settings and you will find the details there if you do not know them.
The Next Values to change are the Email Address that the email will be sent to and also the Email Address that the email will be sent from.
.To = "< Email Address to Send To >"
.From = "< Email Address To Be Sent From >"
.Subject = "SMTP Relay Test"
.TextBody = "SMTP Relay Test Sent @ " & Now()
Now I want to change the text body to display the values that the visitor entered into the form, so I am going to add those variables into the Text Body Section.
.TextBody = "SMTP Relay Test Sent @ " & Now() & vbCrLf & "Surname: " & Surname
& vbCrLf & "First Name: " & FirstName & vbCrLf &
"Email: " & Email & vbCrLf & "Message: " & Message
And that is all there is to it. You should now have a Simple Easy To Use Contact Form Created with ASP and Dreamweaver.
Additional Tasks
1. Add a Thank you Message to the Body of the contact_us.asp Page
2. If you need or want to add some more fields to the form then you will need to do the following:
Find This Section of Code in the contact_us.asp page and add the value (let’s say we wanted phone number) in a couple of spots. On the line that starts with DIM and their also needs to be an entry in the section below that.
Dim FirstName, Surname, Email, Website, Message, PhoneNumber
FirstName = Request.Form("FirstName")
Surname = Request.Form("Surname")
Email = Request.Form("Email")
Website = Request.Form("Website")
Message = Request.Form("Message")
PhoneNumber = Request.Form("PhoneNumber")
The Value that is inside the () needs to be the same as the name of the Text Box on the Form Page and is Case Sensitive. So phonenumber is different to PhoneNumber.
You will then need to edit this section to make that new field appear in the email that is sent.
.TextBody = "SMTP Relay Test Sent @ " & Now() & vbCrLf & "Surname: " & Surname
& vbCrLf & "First Name: " & FirstName & vbCrLf &
"Email: " & Email & vbCrLf & "Message: " & Message
& "Phone Number: " & PhoneNumber
I hope that makes all your life’s a lot easier when creating a Contact Form using ASP. In an upcoming Article I will be showing you How To Configure Form Validation Using Dreamweaver.
If you would like to be like everyone else and receive Tips on How To Improve Your Website then SIGN UP to my Web Design Tips Newsletter.
If you were interested in going the extra mile, in terms of design for your contact form, please download our highly popular tutorial here:
You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

April 23rd, 2008 at 12:17 am
I just tried your tutorial on creating an asp mail contact form and i keep getting a server error 500 page cannot be displayed when it goes to the page with the asp server scripts on in. any idea what I might be doing wrong.
Michael Klocke
April 23rd, 2008 at 7:10 am
@Michael
Make sure your file name of the ASP Page are EXACTLY the same as what you have put in for the form action.
Let me Know how you go. Shoot me an email via the Contact Page.
Cheers
Daniel
April 24th, 2008 at 10:20 am
hello dear friend
i visited your website very first time
i was studying your this article of making contact form in dreamweaver , can you help me in this kind of situation
plz
i made a contact form in ( flash ) but how can i send it to my e-mail , usp this asp code with cdo
hope you have a solution for my this problem
if you can help me then plz help me plz
thank you have a nice day !
April 25th, 2008 at 3:43 am
I just tried your tutorial on creating an asp mail contact form and i keep getting a server error 500 page cannot be displayed when it goes to the page with the asp server scripts on in. any idea what I might be doing wrong.
every thing is the same in my html form also plz help in my e-mail thnak you !
April 25th, 2008 at 5:30 pm
@Sunny
Make sure that your ASP File has exactly the same name (case and all) as what you have put in the Forms Post or Get Method
Let me know via the contact form with how you go.
Cheers
Daniel
April 25th, 2008 at 5:33 pm
@Sunny
Sorry I am not a Flash Guru, so I am unsure how to do that. If any readers use FLash and know how to do this then shoot me an email via the Contact Form
Cheers
Daniel
May 6th, 2008 at 8:28 am
CDO.Message.1 error ‘80040213′
The transport failed to connect to the server.
/Files/contact.asp, line 54
May 7th, 2008 at 7:35 am
I just tried your tutorial on creating an asp mail contact form and it worked great. Now can you tell me how to rediect the page to another page in my website?
Thanks,
Again
May 7th, 2008 at 12:08 pm
@Kenmon
Probably the easiest way to do this in this example is to place a Response.Redirect “yourstie.com” just before the end of the script. EG: just before the %>
Hope that helps.
May 7th, 2008 at 12:27 pm
@JC
The form can’t connect to the Mail Server you specified. Make sure you check these lines:
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = [mailserver]
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = [username]
.Item(cdoSendPassword) = [password]
Shoot me an email and let me know how you go.
May 10th, 2008 at 7:46 am
asda
May 13th, 2008 at 9:48 pm
I am new to both Dreamweaver and ASP
I created a page in ASP (using vbscript) saved it as “.asp” in wwwroot folder.
when i try to open this page it shows a “File downloading” dialog box (showing open and save buttons) instead of the excepted result.
what to do…..???
May 14th, 2008 at 6:41 am
I have followed your tutorial to create a emailing form but when I test it by clicking the submit key it loads my asp page without sending the email. I have used gmail as my email address with the SMTP being smtp.gmail.com is this maybe why I am having an issue.
Please help
Thanks
May 17th, 2008 at 3:32 am
I’m also getting the Error 500 message. I have the action on the form named exactly to the page (contact_us.asp)
Please Help?????
Dave
May 17th, 2008 at 8:10 am
Gives me the same http 500 error. It seems like it is trying to open the asp page. Is that what it supposed to do. And btw, the name is perfectly the same in both files. I copy and pasted it.
May 18th, 2008 at 4:25 am
To fix the Error500, you need to remove the line . Not all servers accept it. I,ve just tested this and and was a great help for me.
Thank you very much Daniel.
May 18th, 2008 at 4:26 am
Line to remove:”.Item(cdoSMTPAuthenticate) = cdoBasic
“
May 21st, 2008 at 6:04 am
Which line should I remove?
May 21st, 2008 at 8:03 am
So i removed the top line which was generated by DW and it worked right away.
Now, I have the other issue. I am using the code for text body where the surname, lastname, etc. are getting populated. When I receive an email however, its not populating. It all comes empty except the text inside the qoutes. Any ideas why?
May 21st, 2008 at 7:56 pm
I’ve attempted the tutorial but keep getting a problem where the code just keeps appearing in the browser
Message Sent
etc………
May 29th, 2008 at 5:57 am
Worked like a charm, many thanks
May 29th, 2008 at 11:20 am
If I sent you my “contact_us.asp file page could you please take a look at it????
Please Please Please
I also don’t know where to place this page on my server space, right in with the rest of the docs?
:(:(:(:(:(
June 11th, 2008 at 10:53 am
Hey your tutorial is really great. But I have a simple question. I want to put a form on my website and how do I know who all have registered. Say if a guy name sam comes and fills the form, how do I know that he did it.
Thanks a lot for your time.
June 16th, 2008 at 6:10 pm
nervate expropriate rivingly urosteon cyclopentanone sermonize darling uncredited
Gibbons Saddlebred Farm
http://www.auriel.org/
June 17th, 2008 at 11:34 pm
What line are we referring to? I am getting the same error but I don’t know what line to take off. What does the line say?
June 18th, 2008 at 8:49 am
Help!!
Altough this script is amazing, all myself and my clients keep getting is the error 405. When I read on, It says the website has a programing error. I have copied it from you exactly.. Please help! The address is: http://www.woodchurchtrust.com/ASPContactForm.html
Thanks
Allan
June 19th, 2008 at 4:49 am
I had a 500 error but that was my fault. After I contacted my tech gurus at Server Intellect they told me I had moved web.config to the wrong directory. Anyways works perfect!
June 28th, 2008 at 3:42 am
Hi,
I did exactly your sample, it works great!
Now I modify it and put in my own details.. I encounter this now
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/contact_us.asp, line 66
& vbCrLf & “Company” & Company
^
June 28th, 2008 at 3:47 am
Hi,
I did exactly your sample, it works great!
Now I modify it and put in my own details.. I encounter this now
Microsoft VBScript compilation error ‘800a0400?
Expected statement
/contact_us.asp, line 66
& vbCrLf & “Company” & Company
^
July 2nd, 2008 at 12:54 pm
I did everything that was on there however it takes me to a page that says HTTP 405 - Resource not allowed…
Any idea what the problem is?
Thanks,
Justin
July 2nd, 2008 at 1:30 pm
Justin
Sounds like your server does not support ASP.
Check with your host.
Cheers
Daniel
July 21st, 2008 at 10:53 pm
Pleas help, the error is
error ‘80040211′
/cgi-bin/contact_us.asp, line 64
July 22nd, 2008 at 9:01 am
I posted the form, but when I visit the page it automatically submits the form (with no answers in the form of course). But the submit button still works, and that sends all the filled out forms. Any ideas on how that could happen?
July 23rd, 2008 at 6:48 am
Hi, thanks for offering this.
Do you know why I recieve this error:
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/contact_us.asp, line 60
& vbCrLf & “First Name: ” & FirstName & vbCrLf &
^
August 4th, 2008 at 7:06 pm
my webhosting says i have no smtp user or pass, and to delete that from the asp file, either way, i get 500 error everytime
August 10th, 2008 at 3:41 am
Rimsky went legate left buy cytotec meat steamed held.
August 12th, 2008 at 4:54 am
Hey!
Thanks brother, this script is really nice and works great!
You have also explained it in a very lucid manner, keep up!
http://www.callingallgeeks.blogspot.com
August 20th, 2008 at 1:41 am
Hi, I follow your instruction. When I click submit button, the website will display all the contact_us.asp codes. Any idea what I’ve done wrong?
August 28th, 2008 at 2:54 am
I’ve never used scripting and I just tried creating a form following your instructions, just wanted to say that your method’s very easy. Thanks, it worked on my first attempt!
August 28th, 2008 at 6:28 am
Hi,
Thanks for the Asp code. I’ve read the thread and tried the suggestions, but still I have an 500 error.
Please help
Regards
August 28th, 2008 at 7:02 am
I followed everything to a T and still getting the 500 error. What line of dw are you talking about deleting. I’ve tried some and still haven’t worked. Please help!!!
September 1st, 2008 at 9:46 pm
hi, i have used your tutorial to make this form but when i click the submit button after filling in the correct information it just pops up a message asking me if a want to open or save the ‘contact_us.asp’ file.
any ideas?? it looks like it is trying to download it rather than just get the information from it??
Pleas let me know…
Many thanks
September 2nd, 2008 at 7:04 am
Hi Daniel,
good tutorial thanks. very easy to follow for a asp newbie. I am getting the same error a fair few people seem to be getting:
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/newtester/pages/contact_us.asp, line 65
& vbCrLf & “forename: ” & forename & vbCrLf & “surname: ” & surname & vbCrLf & “tel_no: ” & tel_no & vbCrLf & “organisation: ” & organisation & vbCrLf & “address: ” & address & vbCrLf & “email: ” & email & vbCrLf & “enquiry: ” & enquiry
^
I have added in extra fields as per your instruction for my form.
the page is in a sub folder on the server it will go live on when complete however i dont have the smtp details yet. could this be a reason why i am getting the error?
I have just been putting in a different pop account details for now (my own ) to try and test it. am i likely to get this same error message when i get the correct pop details in place and if so, and its not anything to do with the sending username and password, then any ideas what the problem with it is?
i understand that the form is unlikely to work properly without the correct sender details but if its throwing this up as a seperate problem i want to get it sorted so i am ready once i get the correct details.
sorry bit long winded that!!
the relevant bits below:
title = Request.Form(”title”)
forename = Request.Form(”forename”)
surname = Request.Form(”surname”)
tel_no = Request.Form(”tel_no”)
organisation = Request.Form(”organisation”)
address = Request.Form(”address”)
email = Request.Form(”email”)
enquiry = Request.Form(”enquiry”)
.TextBody = “SMTP Relay Test Sent @ ” & Now() & vbCrLf & “title: ” & title
& vbCrLf & “forename: ” & forename & vbCrLf & “surname: ” & surname & vbCrLf & “tel_no: ” & tel_no & vbCrLf & “organisation: ” & organisation & vbCrLf & “address: ” & address & vbCrLf & “email: ” & email & vbCrLf & “enquiry: ” & enquiry
September 5th, 2008 at 8:38 pm
hii..i want to create an login form with dreamweaver.with fileds username and password..so that the entry will be saved and the user can log in..please help me in designing it..
September 13th, 2008 at 7:39 am
I’m getting the following error:
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/contact_us.asp, line 64
& vbCrLf & “First Name: ” & FirstName & vbCrLf &
^
…
My smtp doesn’t require authentication - do I delete the lines or leave as it is.
Thanks, Mike
September 26th, 2008 at 7:29 am
I think I followed the above correctly; however, when clicking ’submit’ after filling out the form, it’s directing me to HTTP 404- The Webpage cannot be found.
Suggestions?
Thanks,
October 1st, 2008 at 12:27 pm
Hello,
I’m receiving the e-mails from my website but the information that is input into the form is not being sent through the e-mail. The only thing that comes across is the text box name. What is causing this and how do I fix it?
Thanks in advance!
October 20th, 2008 at 8:22 pm
Error Type:
Server object, ASP 0177 (0×800401F3)
System message, messageid = 0×800401f3
contact_us.asp, line 36
that line is
Set objConfig = Server.CreateObject(”CDO.Configuration”)
October 21st, 2008 at 4:41 am
CDO.Message.1 error ‘80040213′
The transport failed to connect to the server.
—————————————————–
This is my error. Do the smtp server, username and password need to be in quotations? see below.
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = “smtp.xxx.com”
.Item(cdoSMTPServerPort) = 587
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = “xxxxxxx”
.Item(cdoSendPassword) = “xxxxxx”
October 21st, 2008 at 9:09 am
CDO.Message.1 error ‘80040213?
The transport failed to connect to the server.
————————————————
This is my error, do smtp server, username and password have to be in quotations? see below.
.Item(cdoSMTPServer) = “smtp.xxxxxx.com”
.Item(cdoSMTPServerPort) = 587
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = “xxxxx”
.Item(cdoSendPassword) = “xxxxxx”
October 28th, 2008 at 5:49 am
Hi, find your tutorial very useful. However when I run the script on my websire, iget a the below error on IE
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/contact_form.asp, line 62
& vbCrLf & “Name: ” & Name & vbCrLf &
^
Please see the part of the script below where error occurs
With objMessage
.To = “”
.From = “”
.Subject = “SMTP Relay Test”
.TextBody = “SMTP Relay Test Sent @ ” & Now() & vbCrLf & “Comments: ” & Comments
& vbCrLf & “Name: ” & Name & vbCrLf &
“Email: ” & Email & vbCrLf & “Tel: ” & Tel
.Send
End With
Many thanks
October 28th, 2008 at 7:11 am
Hi, please ignore above message. Now I manage to get the email send but there is no content been relay from the form. What i get is as below.
SMTP Relay Test (date)
Comment
Name
Email
Tel
November 4th, 2008 at 3:49 pm
I’m still getting the HTTP 500 error when I submit. The form action name and the file name are the same. There is discussion above about removing a line of the script but I tried that it I still get the 500 error. Any help would be appreciated.
November 22nd, 2008 at 9:02 pm
I have ASP .Net server i can try to create contact us page but error. i have windows server 2003 use,
please if know this code than send code my email id hitsrose@hotmail.com
November 29th, 2008 at 1:53 am
Hi Daniel,
Thanks4 the help…
Just a last question, I still get the error message 405, I believe I did everything as you sugested. My question is about the mai addresses:
on the field .
Item(cdoSendUserName)”what address is this???”
.Item(cdoSendPassword)= “is the pass for my server or my pop3??”
Thanks mate
kobna.
December 4th, 2008 at 6:40 am
I am receiving the same problem as it seems a lot of people are having is there anyone who know how to fix this issue?
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/Contact_us.asp, line 63
& vbCrLf & “First Name: ” & FirstName & vbCrLf &
^
December 16th, 2008 at 4:51 am
Hi,
I have a enquiry form at my contact us page.
I am facing a problem in my enquiry form placed in my ‘contact us’ page. I do not know how and where to use the mailenable component-mail code which I find at http://www.kb.space2host.com Should I have to create new page and upload it together all other pages or this code should use in existing contact us page.
December 28th, 2008 at 9:03 am
Hey i wanted to know what to put for setting up where the email is going to be sent from if lots of people will send email from their own email sorry but i am new to this
thank you very much
.To = “”
.From = “”
.Subject = “SMTP Relay Test”
.TextBody = “SMTP Relay Test Sent @ ” & Now()
January 1st, 2009 at 10:52 am
I am getting a error
error ‘80040211′
/template/contact_us.asp, line 65
I don’t really know what to do. Can you please help?
January 7th, 2009 at 4:08 pm
Thank you so much for this post. I have the same question as Diego . . . How do you complete the e-mail from?
January 8th, 2009 at 1:31 am
The “from” is the valide-mailaccount@thedomain.com
January 15th, 2009 at 9:36 pm
Hi,
I get the same error as a lot of people here, but I haven´t seen it solved yet. Is there anyone who can help?
Microsoft VBScript compilation error ‘800a0400?
Expected statement
/Contact_us.asp, line 63
& vbCrLf & “First Name: ” & FirstName & vbCrLf &
January 31st, 2009 at 2:59 am
Thank you for this tutorial, I too am having problems however. I get this message when submitting the form:
Method Not Allowed
The requested method POST is not allowed for the URL /contact_us.asp.
…any suggestions? Thanks
February 11th, 2009 at 4:35 am
For all you folk who get this message:
CDO.Message.1 error ‘80040213?
The transport failed to connect to the server.
/Files/contact.asp, line 54
and are using a hosting company who use Microsoft Exchange (lots do), try using “localhost” as the SMTP server. Line as below.
.Item(cdoSMTPServer) = “localhost”
February 11th, 2009 at 10:21 am
….and I have to say I struggled to get this script to work for weeks but I persevered, learnt a hell of a lot and got there in the end. My errors, like most folks, are simple typos and getting the SMTP server name wrong!
This script is spot on and I am very grateful to you Daniel for posting it.
February 14th, 2009 at 4:59 am
I’m quite new with ASP, I did the form but I also get the error 500, and really don’t know how to fix it. Also, I want to redirect to thank-you.htm with response.redirect, I’m just not sure where to put it in my contact_us.asp page. Can you help me. Thanks!
March 2nd, 2009 at 5:45 pm
I am getting the same error about not connecting to the server
CDO.Message.1 error ‘80040213′
The transport failed to connect to the server.
/contact_us.asp, line 57
Everything is correct as it is the same as in my mail service that I use. Any suggestions?
March 2nd, 2009 at 5:51 pm
I tried sues suggestion…I using Godaddy, not sure if they use MS Exchage, but this is the new error I get.
error ‘8004020f’
/contact_us.asp, line 57
March 2nd, 2009 at 6:08 pm
Ok so after tweaking with it I got it to work, however now the First Name and Message are blank. I get Surname and Email, but nothing else. Here is the way that I have the script:
.TextBody = “SMTP Relay Test Sent @ ” & Now() & vbCrLf & “Surname: ” & Surname & vbCrLf & “First Name: ” & FirstName &vbCrLf & “Email: ” & Email & vbCrLf & “Message: ” & Message
March 3rd, 2009 at 5:40 am
That 800a0400 error is a syntax problem. I think it’s line 54 or 56, you have to check the quotes and make sure everything is correct when you add your information.
March 5th, 2009 at 7:04 pm
Can this tutorial be used for Dreamweaver 8.
Hi, thanks for this tutorial.
Do you know why I recieve this error:
Microsoft VBScript compilation error ‘800a0400?
Expected statement
/contact_us.asp, line 64
& vbCrLf & “First Name: ” & FirstName & vbCrLf &
^
March 7th, 2009 at 3:51 am
Anyone know how to add a simple validation to one of the text fields?
March 12th, 2009 at 11:52 pm
I have a completely different problem - I dont know what to put in the
With objMessage
.To = “”
.From = “”
If anyone can quickly point out what I need to do, that would be great.
April 30th, 2009 at 9:55 pm
I had all of the errors you are on about! If you go to internet options and click the advanced tab, unclick show friendly HTTP error messages. This will remove the HTTP 500 error message and give you the proper error for troubleshooting. I found the error to be that this line
.TextBody = “SMTP Relay Test Sent @ ” & Now() & vbCrLf & “Surname: ” & Surname & vbCrLf & “First Name: ” & FirstName &vbCrLf
all of the fields need to be on the same line, the code you paste automatically puts the “& vbCrLf & “First Name: ” & FirstName & vbCrLf &” on the line below. Make sure its all on one line. Also the email and server settings should be as follows
.Item(cdoSendUserName) = “yours@yours.com”
do not include ><
Hope this helps, I had all of the problems you had!!!
May 13th, 2009 at 11:21 pm
thank you Jim. you are a life saver. both your suggestions made it work for me.
May 23rd, 2009 at 4:58 am
Consegui fazer funcionar.
Muito Obrigado!
June 4th, 2009 at 8:30 pm
hello
just wanna ask you that
how do we
Send by email , the form content by email using asp.net in Dreamweaver
June 30th, 2009 at 5:22 am
Works for me unless I am sending email to a few thousand email addresses. Then I get the transport failed error as others have mentioned
July 3rd, 2009 at 9:02 pm
hi. thanks for this tutorial.
one question:
i want use this process for arabic characters.
when i use, it just send “???”.
any idea?
July 4th, 2009 at 4:19 pm
Hi, I am trying to make a contact page but I become confused after what to do after I put in the email where it will be sent to (my email).
July 17th, 2009 at 6:57 am
I downloaded the samples and it worked like a charm!!
July 28th, 2009 at 6:46 am
I’m still getting the HTTP 500 error when I submit. The form action name and the file name are the same. There is discussion above about removing a line of the script but I tried that it I still get the 500 error. Any help would be appreciated
August 12th, 2009 at 3:30 pm
Hi There,
help?
I am also still getting the 500 error after trying all of the suggestions above.. can I send you my .asp file to see what i’m doing wrong? I’m supposed to launch this thing in a couple days and I’m at a loss
August 13th, 2009 at 9:37 am
I got this error and don’t know how to fix it
error ‘8004020f’
/forms/contact_us.asp, line 63
August 16th, 2009 at 2:34 pm
Hello,
I would like to say that your instructions are great. I am having an issue with the script. When I click submit, it goes to another page that say “Your response …. ” however, the problem is that I do not receive the email. What do you think the issue is? I have not uploaded this to the server as of yet, I am only testing this through my computer.
September 1st, 2009 at 3:08 am
All of you who are getting the following error message:
CDO.Message.1 error ‘80040213?
The transport failed to connect to the server.
and using GoDaddy, please remember that Godaddy uses port 80.
So change line: .Item(cdoSMTPServerPort) - 80
October 2nd, 2009 at 7:56 am
hi there sir. your tutorial is good. i just want to ask on how those messages to be shown below the submit button? i just want to show all the messages to the public. like the role of the guestbook in other websites. do u have any tutorials regarding on my demand sir? same logic as this but it lacks on how to display it below the page. an additional tutorial on how it store the messages and info in a database like access is a plus. thank you! ^_^
October 31st, 2009 at 4:03 am
For anybody having issues with 500 internal server error, and uses GoDaddy hosting, make sure your cdoSMTPServer is set to relay-hosting.secureserver.net. Also, SMTPserverport 25 worked for me, although 80 or 3535 might work for others. Hope this helps.
November 17th, 2009 at 8:38 am
Thank you very much, the code goes excelent
November 26th, 2009 at 9:31 pm
Stupid question I know…but how do I fill in this variable? It is marked in red, as something I have to change:
“”
Sorry…new to forms :o)
December 2nd, 2009 at 8:31 pm
This is great. I spend a few weeks to search for asp coding to create this feedback form but what I can get is headache because it got all the errors all the time. You coding and explanation work perfectly and it is very easy to understand.
Thank you so much. You have my days….:D
December 3rd, 2009 at 2:02 pm
I followed your instruction to create a contact form in Dream weaver and it woks great but I got an error when I use yahoo account to fill the form. Have you ever meet this problem? I try to fill the contact form with different kind of email address and it works good but when I use yahoo account it’s errors and the message is not send out also. Please help me with this.
Thank you
December 21st, 2009 at 9:06 am
AHHHHHH - I keep getting the following:
Microsoft VBScript compilation error ‘800a0400′
Expected statement
/ccs/documents/contactus_email.asp, line 60
With Fields
But there is nothing wrong with this line - it just has the words “With Fields” exactly as mentioned in your code - I’ve checked all the pop3 and outgoing usernames etc and it’s all correct - I’ve changed it to all sorts of different accounts and I always get the same: ahhhhhhh - my form was working just fine and now I just can’t get it to work - what’s going wrong?
January 14th, 2010 at 10:57 pm
Hi there, I’ve used your code to make a “submit news article” feature for my website but I keep coming up against problems.
With the POST Method I get:
405 Method Not Allowed
The requested method POST is not allowed for the URL /news/submit/contact_us.asp.
With the GET Method I get:
The coding on the page for “contact_us.asp”
Can someone please please me?
Thanks Matt
mattyblog.cookynet.com (mattyblog@hotmail.co.uk)
January 18th, 2010 at 12:01 pm
tutorial really easy to follow except I have problem where contact_us.asp code is displayed after submit button clicked. How do I resolve this? Also, it seems that the code is not being executed as I’m not getting an email in exchange. Any ideas?
January 26th, 2010 at 8:44 am
CDO.Message.1 error ‘80040213′
The transport failed to connect to the server.
/contact_us.asp, line 68
I have double checked my settings…pretty i have the correct smtp server (mail.monkeybuttstudios.com) as well as user name and pwd. Any other thoughts?
January 26th, 2010 at 8:50 am
Changed the SMTP port…
error ‘80040211′
/zolex/aspcontactform/contact_us.asp, line 68
February 12th, 2010 at 7:52 am
I have tried using this code and I keep getting Bad Request (Invalid Hostname), I have the correct smtp server name and the correct ports and everything and just can’t get it to work. Is any of this code old now and doesn’t work as I see this is an old article. Please email me with an answer and thanks!
Fred
February 17th, 2010 at 10:19 pm
Hello, first part of tutorial was very easy, second part took me down. It’s my first time experience with asp.
When I created new asp page in dreamweaver cs4, it had starting code:
Untitled Document
Thank you for your comment!
Thank you msg I wrote in body section just like you said to do so. But where do I paste the other huge code into this lil code? Does it go into body section too? Before body?
Thank you!
March 13th, 2010 at 12:14 am
Thank you so much for this tutorial! It works great!
March 30th, 2010 at 2:27 am
I am getting the following error:
Error Type:
(0×8004020E)
Cannot modify or delete an object that was added using the COM+ Admin SDK
/contact_us.asp, line 67
What to do??
March 30th, 2010 at 2:27 am
The line is
.Send
May 6th, 2010 at 12:00 am
tried as per your instructions, inserting the ASP code but just seeing the codes in design view instead of code view before I even test.What could be wrong ?Pls help