Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-12-2011, 05:39 PM   PM User | #1
SHEPME
New Coder

 
Join Date: Mar 2011
Posts: 94
Thanks: 7
Thanked 0 Times in 0 Posts
SHEPME is an unknown quantity at this point
email form handler, help

Good day:
I am trying to use the following .asp script to handle the form that I have on my website. I would like that after the user hits the "submit" button, it takes him or her back to a specific web page (in this case bodies.htm). My 1st question is the coding for this accurate?
Can I test this on my desktop before I uplaod it to my server. I have been messing around with it all morning and can not get it to work. Any assistance would be much appreciated.
Shepard

html
-------
<form method="post" action="sendmail2.asp">
<p align=center>Your Name:<input type="text"size="35"name="Name"></p>
<p align=center>Your E-Mail:<input type="text"size="35"name="email"></p>
<p align=center>Your Message:<br/>
<textarea rows="8"cols="40"name="message"></textarea></p>
<p align=center><input type="submit" /></p>
</form>

.ASP
-------
<%
'-----EDIT THE MAILING DETAILS IN THIS SECTION-----
dim fromName, fromAddress, recipientName, recipientAddress, subject, body, sentTo

fromName = Request.Form("Name")
fromAddress = Request.Form("email")
recipientName = "Shepard micaels"
recipientAddress= "michaels@bellsouth.net"
subject = "Website Contact Form"
body = Request.Form("message")

'-----YOU DO NOT NEED TO EDIT BELOW THIS LINE-----


sentTo = "NOBODY"
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = fromName
Mailer.FromAddress = fromAddress
Mailer.RemoteHost = "mrelay.perfora.net"
if Mailer.AddRecipient (recipientName, recipientAddress) then
sentTo=recipientName & " (" & recipientAddress & ")"
end if
Mailer.Subject = subject
Mailer.BodyText = body
if Mailer.SendMail then
Response.Redirect "bodies.htm"
else
Response.Write "YOU MUST ENTER YOUR EMAIL ADDRESS. PRESS BACK BUTTON. Error was " & Mailer.Response
end if
%>
SHEPME is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:43 PM.


Advertisement
Log in to turn off these ads.