|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
hi,
i want to create a simple contact form, sending it using asp language. Please could someone offer me advice on how i can do this. i guess i will need an asp file to work alongside the html form page on the server. anyone got any code for this? your help would be much appreciated! |
|
#2
|
|||
|
|||
|
OK
ASP is **NOT** a language! ASP is a **SERVER-SIDE** technology built by Microsoft to kind of replace CGI script. Because CGI script where little .exe on the server, they where hell to debug and make work.(ok there is more to that but you get the picture...) Now, ---BEGIN QUOTE-- i want to create a simple contact form, sending it using asp language ---END QUOTE-- What is a contact form ? Can you tell us more about that? I have a better approach, why don't YOU tell us what is it you want, in words. Don't try to describe it code wise, simply say something like: " I want the user to fill in a form on the internet. Have a button that once clicked, sends an email to my boss " Another thing, can you run asp pages on your server? If you copy/paste this: ------------------------------------------------------------------- <%@ Language=VBScript %> <html> <body> The date and time is <%=Now()%> </body> </html> ------------------------------------------------------------------- and save it as test.asp Notice the extension, its .asp !!! Then run it, does it work ??? If it does, then yes you can run ASP pages on your server. If it doesn't then make sure IIS is installed on the server! But what is IIS ? Hum...well...if that is the case then perhaps creating the contact form isn't your biggest problem ;-) Seriously though, re ask your question like if the application was finished, what is it you want it to do? Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
Thanks for your response,
ok basically i want the user to be able to fill in a form on the internet. And have a button once clicked, sends an email to me. with the content from the form. I have just checked the asp on the server, and it works!! do u understand me now? thanks for ya help |
|
#4
|
|||
|
|||
|
Yes :-)
That's great! Ok so you'll need to create the <form>...</form> with all the relevant HTML controls that YOU want YOUR users to fill in! Create a submit button inside the <form>...</form> Have the action attribute set to something like: action="sendemail.asp" Also have the method attribute set to : method="POST" Then create the sendemail.asp page. Inside the page(sendemail.asp) create variables in which you'll assing the values of your <form>...</form> into example: <% Dim strFirstName Dim strLastName strFirstName = Trim(Request.Form("txtFirstName")) strLastName = Trim(Request.Form("txtLastName")) 'FOR DEBUG ONLY 'Response.Write "FirstName : " & strFirstName & "<hr>" 'Response.Write "LastName : " & strLastName & "<hr>" 'Response.End %> Then you create your mail object and send the email... Start with that, if you have any problems post the error messages and/or questions! Hope this helps! Sincerely Vlince |
|
#5
|
|||
|
|||
|
thanks
thanks Vlince!
i will give that a go! |
|
#6
|
|||
|
|||
|
question????
ok i've created the HTML file: form code...
<form> <p> <input name="strFirstName" type="text" id="strFirstName"> </p> <p> <input name="strLastName " type="text" id="strLastName "> </p> <p> <input type="submit" name="Submit" value="submit" action="sendemail.asp" method="POST" > </p> </form> my asp file is as follows: <% Dim strFirstName Dim strLastName strFirstName = Trim(Request.Form("txtFirstName")) strLastName = Trim(Request.Form("txtLastName")) 'FOR DEBUG ONLY 'Response.Write "FirstName : " & strFirstName & "<hr>" 'Response.Write "LastName : " & strLastName & "<hr>" 'Response.End %> i am not sure how you create the mail object, so i can recieve the email. Hope this makes sense....? |
|
#7
|
|||
|
|||
|
OK...first thing:
remove the: action="sendemail.asp" method="POST" from within your <submit> button. It doesn't go there... It goes here: <form name="frmMain" action="sendemail.asp" method="POST"> . . . . . . <submit button> </form> Then you say: --BEGIN QUOTE--- i am not sure how you create the mail object, so i can recieve the email. Hope this makes sense....? --END QUOTE--- For the record, you are NOT receiving emails(unless the you send it to yourself) but you are SENDING an email from your ASP page. Its very important to understand that(although I know you know I just had to say it!) Now...are you, or should I say, is your company planing on buying an email component? such as JMAIL for example? *******OR******* Are you going to use the CDONTS(Ah I don't remember the exact name before someone attacks me...) *******OR******* You have absolutely NO clue of what I speak? |
|
#8
|
|||
|
|||
|
ok?
ok with the changes you suggested, when i press the submit button it takes me to sendemail.asp.
what i want the form to do is: when the user fills in the text fields and presses the submit button. i want the content of the fields sent to my personel email address. any suggesting on how to do this? |
|
#9
|
|||
|
|||
|
Yes I know that, I mean I know that you'd like to send an email with the <form>'s information to yourself but my question to you is:
What are you going to use to send that email? You have TWO choices 1) Use the embedded one CDONTS OR 2) Use a third party component such as JMAIL If you DON'T know which is what or what is what then read/search google.com for "What is CDONTS" or "how to send email using ASP" Now the reason why I made you declare variables is to put the user's information, the ones they entered in your <form>...</form>, in those variables. Then, once they are inside the variables, you can play with them What do I mean by "play" I mean you can do whatever you want cause they are now inside variables. So for example, you could "send an email" or you could "insert them in your database" or you could "create an XML file" or you could .... I also asked you to put the values of the <form>...</form> into variables for CLARITY Since you're beginning, its important that your CODE is readable, trust me... Now decide on which choice you'll make/take then...we will see Hope this helps! Sincerely Vlince |
|
#10
|
|||
|
|||
|
There is also the mailto: thing inside your <form> that you can use but I've heard it isn't reliable...
Can anyone say anything about this?... Vlince |
|
#11
|
|||
|
|||
|
here's the big kicker for me, if you have java validation such as making sure the user enters a TO address, that passes on the submit call, and then when the send mail pops up, depending on how you have everything set up, if you don't encrypt it, windows asks you if you want to send it in plain view, and most users are scarred by this and hit cancel. Now the java has already given the ok on submit but the user can change stuff and then the application blows up and it's just not fun. It'd be easier just to submit to another page and handle it through cdonts, cdo, or outlook etc...
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > contact form HELP...Please! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|