473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp form processing - send email

14 New Member
I want to send form data to email using ASP (post method). I am trying following script but it's not working.Please suggest. Also suggest how to redirect it after pressing submit button.
Expand|Select|Wrap|Line Numbers
  1. <% 
  2. Dim name, phone,city, email, mail
  3.  
  4. name=Request.Form("name")
  5. phone=Request.Form("phone")
  6. city=Request.Form("city")
  7. email=Request.Form("email")
  8. Response.Write("Name: " & name & "<br />")
  9. Response.Write("Phone: " & phone & "<br />")
  10. Response.Write("City: " & city & "<br />")
  11. Response.Write("Email: " & email & "<br />")
  12.  
  13. Set myMail=CreateObject("CDO.Message")
  14. myMail.Subject="IIT paper"
  15. mail.To = "prabodhan17@gmail.com"
  16. mail.From = Request.Form("name")
  17. myMail.Send
  18. set myMail=nothing
  19. Response.Write("Mail Sent!")
  20.  
  21. %>
Apr 28 '09 #1
2 2881
jhardman
3,406 Recognized Expert Specialist
I've asked someone else to look into this question, since I always get frustrated with email scripts. The first question I have is, are you sure the form is coming through correctly? You can check with this simple code:
Expand|Select|Wrap|Line Numbers
  1. for each x in request.form
  2.    response.write x & ": " & request.form(x) & "<br>" & vbNewLine
  3. next
  4.  
To redirect, you just need to do this:
Expand|Select|Wrap|Line Numbers
  1. response.redirect "somePage.asp"
but it won't work if you have any response.write on the page, so don't try to add it until you have everything else straightened out, and you can delete or comment out all of those lines.

Let me know if this helps.

Jared
Apr 30 '09 #2
colinod
347 Contributor
Hi

In the from name field on the form are you outting a name or an email address, if its a name only i think it has to be an email address.

Give that a try and let me know

Colin
Apr 30 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2011
by: Christian | last post by:
Hello, is it possible to get everything between <form></form> into an variable even the plain text so i can work with it and write it to a file? thanks for the advice chris
8
5081
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation, post values go to a PHP processing page that adds values to a database and generates an email to someone in marketing. For three of these sites,...
13
69984
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do this? I've tried using: header("Location:http://www.mysite.com/send-confirm.php");
27
4701
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it appears that the data goes straight to the processing page, rather than the javascript seeing if data is missing and popping up an alert. I thought it...
6
2639
by: Spycat | last post by:
Hi all and happy holidays! I should start off by stating I am NOT a PHP programmer. I say that so that in any response to me, you will speak very s-l-o-w-l-y or I won't know what you're talking about ;-) I have this form processor script that I basically pieced together from 3 different scripts. The script includes a CAPTCHA image...
4
2614
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered before the list is repopulated. For example, suppose the user selects 3 in the drop down list and 3 text fields are shown. If the user populates the...
7
3592
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
10
20890
by: Big Moxy | last post by:
I want to redirect the user back to the home page after submitting their form inquiry and display a message on the home page. I tried this in my send mail (apply.php) file - $_SESSION == "Thank you for your request! Someone will be contacting you soon."; header("location:index.php"); but got this error -
3
2830
by: jerry101 | last post by:
Okay, so I have no knowledge with ASP and I was asked to look at this contact form because the emails aren't delivering. I'll post the whole page of code, because I am unsure at what is what really apart from the common knowledge stuff i.e. the send email to etc, but this wasn't designed by me so I am unsure if it's wrong or right.. If...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.