473,471 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create 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 2873
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
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
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,...
13
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...
27
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...
6
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...
4
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...
7
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
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...
3
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.