ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old August 14th, 2003, 03:45 PM
chetwood chetwood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 15 chetwood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb contact form HELP...Please!

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!

Reply With Quote
  #2  
Old August 14th, 2003, 03:57 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old August 14th, 2003, 04:14 PM
chetwood chetwood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 15 chetwood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb ?

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

Reply With Quote
  #4  
Old August 14th, 2003, 07:58 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #5  
Old August 15th, 2003, 05:16 AM
chetwood chetwood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 15 chetwood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks

thanks Vlince!

i will give that a go!

Reply With Quote
  #6  
Old August 15th, 2003, 10:05 AM
chetwood chetwood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 15 chetwood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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....?

Reply With Quote
  #7  
Old August 15th, 2003, 10:28 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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?

Reply With Quote
  #8  
Old August 15th, 2003, 10:43 AM
chetwood chetwood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 15 chetwood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #9  
Old August 15th, 2003, 10:52 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #10  
Old August 15th, 2003, 11:16 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #11  
Old August 15th, 2003, 12:34 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 54 sec
Reputation Power: 6
Send a message via AIM to unatratnag
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...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > contact form HELP...Please!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway