All source code in ASP/ VbScript Ask a ASP/ VbScript Pro Discussion Forum Categories All jobs in ASP/ VbScript
Quick Search for:  in language:    
HTML,code,used,send,form,information,your,ema
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 281,252. lines
 Jobs: 101. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login

NEW! LEARNING CENTER
Special educational offers, white papers, webcasts, podcasts

  NEW! Download Rational Performance Tester V8 (download now)
  NEW! Download Rational Functional Tester V8 (download now)
  NEW! Download Rational Service Tester for SOA Quality V8 (download now)
  NEW! Teleconference: Quality In Action - Using Rational Quality Manager with Functional, Performance and Web Service Testing Products (download now)
  NEW! Introducing IBM Rational AppScan Developer Edition – easing security testing by non-security professionals (download now)

 

 


Latest postings for ASP/ VbScript.
Web Online Examination
By Suhas Manjunath Kashyap on 11/7


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

EMail Forms

Print
Email
 
winzip icon
Submitted on: 11/20/2000 2:50:04 PM
By: Richard Thurgood 
Level: Intermediate
User Rating: By 21 Users
Compatibility:ASP (Active Server Pages)

Users have accessed this code 59861 times.
 
 
     This code is used to send form information to your email account. Essentially, it sends an HTML email with some basic information to an email account and a link to view the completed form. It uses CDONTS to send the information. The link contains all the information the user entered on the form and when you click on the link, it populates the form with that information. No database needed! It is really simple but since no one else has submitted something like this, I thought I would make my own contribution. There are three .asp files (and some graphics) and one .htm file and the source is very straight forward. Unzip to your wwwroot and give it a try! Be sure to change the SendTo address so it goes to your email account. Good luck!
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
11/26/2000 1:58:57 AMKaustav

Hi Richard!

I just had a question. When I ran your script, I got an error message. This is what PWS told me:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/asp/email/submitform.asp, line 72

800401f3

Could you fix that, or is something I'm doing wrong?
(If this comment was disrespectful, please report it.)

 
11/26/2000 10:29:29 AMRichard

Hi Kaustav ,
You must have CDO installed in order for this to work. Visit To find out more about CDO, go to
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/cdo/_olemsg_
overview_of_cd o.htm (that's the MSDN url) for more information.
(If this comment was disrespectful, please report it.)

 
11/26/2000 3:12:58 PMKaustav

Thanks Richard! I'll try it out ASAP! :D
(If this comment was disrespectful, please report it.)

 
1/11/2001 2:01:58 PMjoe

richard,

i tested your email script with microsoft's PWS. i registered the CDO which corrected the
(If this comment was disrespectful, please report it.)

 
1/11/2001 2:05:00 PMjoe

richard,

i tested your email script
with microsoft's PWS. i registered the
CDO which corrected the 'Server object error'. but, i am now receiving the following error:

error '80070003'
The system cannot find the path specified.

/submitform.asp, line 80

can you explain this to me?

thanks for your time.
(If this comment was disrespectful, please report it.)

 
1/25/2001 9:10:14 PMcasa

hi,
i have tested your scripts although the transmission is successful but i did not receive the mail is there something i left out? or is there some path i should change? i have change this part to my email <INPUT TYPE=
(If this comment was disrespectful, please report it.)

 
1/25/2001 9:10:29 PMcasa

hi,
i have tested your scripts although the transmission is successful but i did not receive the mail is there something i left out? or is there some path i should change? i have change this part to my email INPUT TYPE="hidden" NAME="SendTo" VALUE="myemail@privylink.com.sg"
from emailform.asp
thanks and regards,
casa

(If this comment was disrespectful, please report it.)

 
2/25/2001 2:16:23 PMJesstech

What does

'change this to the appropriate http
Const strHTTP =
(If this comment was disrespectful, please report it.)

 
2/25/2001 2:20:18 PMJesstech

What does

'change this to the appropriate http
Const strHTTP = "http://localhost/"
mean?

(If this comment was disrespectful, please report it.)

 
2/28/2001 5:14:06 AMprose@mail.dk

I have exact the same problem as mentioned here:

I am now receiving
the following error:

error
'80070003'
The system cannot find the
path specified.

/submitform.asp,
line 80

can you explain this to
me?
thanks for your time.

Per Rosenbeck

(If this comment was disrespectful, please report it.)

 
5/14/2001 5:04:38 AMharsha

at the place of localhost you need to place a mail server name...i will be happy if i can find a remote mail server for the purpose,dear author can you tell us some remote mail servers or what should be placed in the plcae of localhost
(If this comment was disrespectful, please report it.)

 
7/6/2001 1:38:33 PMkui

Awesome! This works great! Just remember what directory you're in when you fill out

Const strHTTP "http://localhost/"

in submitform.asp

Otherwise this is awesome!
(If this comment was disrespectful, please report it.)

 
9/24/2001 5:24:27 PMBiki

Thanks, this is the first script that really worked!!!
(If this comment was disrespectful, please report it.)

 
10/6/2001 5:36:13 AMkarimulla

When i test ur script i got this.Will pease why it is coming.my mail ID kareem@pgriyadh.com
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/emailform/submitform.asp, line 9, column 40
Const strHTTP =
(If this comment was disrespectful, please report it.)

 
10/6/2001 5:39:35 AMkarimulla

I tested ur scirpt,but i was unable to success.will u plz let me know why it is happing
Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/emailform/submitform.asp, line 9, column 39
Const strHTTP = "http://webmail-server/

(If this comment was disrespectful, please report it.)

 
10/18/2001 10:15:01 AMsaad

Hi Rich,
I got the code work, and I ger the email, but when I click the lick it get back with error that " The page you requist not avaiable" I wonder what i am doing wrong, as I read the comment left here, someone mentioned the strhttp where it said "http://localhost" should that be change? and if so, what should be replace it with the webserver name, or director name? Please let me know

thanks
(If this comment was disrespectful, please report it.)

 
10/19/2001 5:26:22 PMsaad

I solved the above error. I do have problem with emailing, when I email to internet email the email would not reach it destination, but when I send it to the local domian which is the exchange server same as iis the email will be reached. I know I am in the internet side, and should not be matter, but still the email will not go anywhere, any clue?
(If this comment was disrespectful, please report it.)

 
2/3/2002 12:54:14 PMRandall

Hey Richard,

I downloaded the script from the site and find it very useful.

I have a problem though, I can't seem to be able to receive the email sent. Any ideas on how to get that working? 've just checked with my hosting company whether they have CDONTS installed and they said yes.

Please help.

Thanks
(If this comment was disrespectful, please report it.)

 
2/4/2002 9:01:46 PMWeb Designer

This script is excellent!

(If this comment was disrespectful, please report it.)

 
3/6/2002 10:34:09 PMJackie

Hi Richard!
M looking for the form mail, Let my visitors my email account, if you this script could give me?
(If this comment was disrespectful, please report it.)

 
6/28/2002 6:58:14 AMJim

Hey Richard,

Awesome sourcecode - worked just like a dream! Yuo deserve 100.000 ratings :-)
(If this comment was disrespectful, please report it.)

 
7/17/2002 8:02:02 AMSela

Hi Richard, the problem is that if I add a textarea then put a lot of information it accepts and mail the client the link. But, when the client click on that link, nothing comes up. In other words the page cannot open. But, if i put few characters, the link works without a problem. Do you perhaps know how can I break this long text in textarea so that we don't have that problem again. Waiting paitently for your reply
(If this comment was disrespectful, please report it.)

 
7/21/2002 11:23:11 AMBugs

Kaustav This is for the only problem that i see u facing is that the Server.CreateObject....thats because u must be using Windows 98..or so and CDONTS will only work on 2000 or greater cause the components of CDONTS are only available with IIS and not PWS(used in win98)...So the only soultion to ur problem is install 2000 or host u r pages on the sites containing CDONTS
(If this comment was disrespectful, please report it.)

 
7/24/2002 5:57:26 PMMetasoft

Hey, uh I'm kind new to this sort of thing, and I can't seem ot get ANY of the asp existing on earth to work, this oneincluded. It just givs me a window that displays the asp... much like a hyperlink to the code... plz help-apiwizz@cs.com
(If this comment was disrespectful, please report it.)

 
7/24/2002 5:57:32 PMMetasoft

Hey, uh I'm kind new to this sort of thing, and I can't seem ot get ANY of the asp existing on earth to work, this one included. It just givs me a window that displays the asp... much like a hyperlink to the code... plz help-apiwizz@cs.com
(If this comment was disrespectful, please report it.)

 
10/2/2002 6:01:41 AM

Dear sir!
Thanks for so kind help!
I am facing the following error after I upload the source files on my server. My server type is windows
The error is :-Microsoft VBScript runtime error '800a0046'

Permission denied

/submitform.asp, line 80

your quick reply will be highly apprciated.
Thanks
(If this comment was disrespectful, please report it.)

 
12/19/2002 7:21:34 PM

Like some of the other postings I have read, I do not ever get the email after submit is clicked. I don't get any errors or anything, just no email response.

Any suggestions?

Thanks.

David
(If this comment was disrespectful, please report it.)

 
1/16/2003 3:22:36 PM

The code works like a charm, with one small exception. when you add a textarea and enter a large amount of text, the resulting link wipes the textarea clean. Any ideas?

As it stands, I give this a 99.99% approval rating. :-)
(If this comment was disrespectful, please report it.)

 
1/31/2003 4:23:53 PM

Hello,

I look forward to using your ASP code but I cannot get it to work. When I try it I get the following error message "Microsoft VBScript runtime error '800a0046'

Permission denied

/test/submitform.asp, line 80
"

Could you please help me solve this issue.

Thank you.
(If this comment was disrespectful, please report it.)

 
2/14/2003 1:12:49 PM

Having troubles finding how to configure the CDO. I am running this script on IIS and have an Exchange 2000 environment. Not a programmer or an admin, just trying to help. Can anyone help me??
(If this comment was disrespectful, please report it.)

 
2/27/2003 9:46:36 AM

Hey..Rich
THe code is excellent..thank you...
But could me tell me what script i could use for a text area
THanks again
(If this comment was disrespectful, please report it.)

 
3/19/2003 5:36:03 AM

I just had a quick read through on all of the feedback, and i just wanna say that this is a great bit of asp. But one thing that really annoys me is the fact that you cant use a text area because it always appears blank when you get the confirmation email. Does anyone know how to get this working? Because at the moment im just having a very long text box instead.
(If this comment was disrespectful, please report it.)

 
4/8/2003 12:30:05 PM

Script worked great - expect I too could not get textarea fields to work...what is the answer? Only see questions posted here..

PS - would love to have a way to have the client attach a file to the email - any suggestions?
(If this comment was disrespectful, please report it.)

 
5/24/2003 6:55:50 PM

let me know what about to write down after http://locolhost
should i put websever as i cannot find the form completed while i opened the email for testing it.
(If this comment was disrespectful, please report it.)

 
5/30/2003 6:12:03 PM

Can you tell me how to get the <textarea> fields to work after the data has been processed? All I get in the email is a blank <textarea> field with none of the information I just entered in it. Thanks, DL
(If this comment was disrespectful, please report it.)

 
6/8/2003 5:23:48 PM

Can you tell me how to get the <textarea> fields to work Thanks Alan
(If this comment was disrespectful, please report it.)

 
6/8/2003 5:26:00 PM

I have the same problem Can you tell me how to get the <textarea> fields to work after the data has been processed? All I get in the email is a blank <textarea> field with none of the information I just entered in it. Thanks AM
(If this comment was disrespectful, please report it.)

 
7/7/2003 3:52:31 PM

I also have the same problem with the text area field and could use some help, also the listbox fields. any ideas? btw, I have the script updates to update your script to work with windows 2000 exchange server and XP IIS, just let me know if you want it.
(If this comment was disrespectful, please report it.)

 
7/7/2003 3:55:49 PM

Anyone that knows the answer to the textarea field question, I would greatly appreciate it, also any clues on how to do a listbox field. PS I have the script updates so that the code works on XP IIS and Windows 2000 exchange server, email me at cowings@vt.edu
(If this comment was disrespectful, please report it.)

 
7/9/2003 3:01:23 PM

I have ALL the code!! Text areas, select boxes, and updated for XP/2000!!If you want it, email me at cowings@vt.edu and I'll get you the files.
(If this comment was disrespectful, please report it.)

 
8/27/2003 9:31:25 AM

This code does not work. I am not sure but it may be just old. So far I have not found ANY working ASP code that will allow me to email
(If this comment was disrespectful, please report it.)

 
9/7/2003 7:38:46 PM

I received the email but comes through as a .att file that I cant open. How Can I Change this?
(If this comment was disrespectful, please report it.)

 
9/19/2003 8:33:02 AM

I never receive the email. Does the user have to have 2000 or server?
(If this comment was disrespectful, please report it.)

 
9/23/2003 4:35:47 AM

The email can be sent, however, I never recieve it. May I know why? Thanks...
(If this comment was disrespectful, please report it.)

 
10/2/2003 1:51:51 PMbrianlaf

Excellent code! Works fine on our Intranet. Add Case "ara" Response.Write Request(objName)in scripts.asp. Name the textarea with prefix "ara" in emailform.asp

(If this comment was disrespectful, please report it.)