User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 375,172 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,096 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1289 | Replies: 1
Reply
Join Date: May 2006
Posts: 1
Reputation: millionnaires11 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
millionnaires11 millionnaires11 is offline Offline
Newbie Poster

Help ASP help for newbie

  #1  
May 19th, 2006
I have a form that once submitted needs to send the results to an email address and also send a personalised email responder to the customer who has filled out the form. I have figured out most of the code but am missing the linking code that makes it all work. So far the results are emailed correctly but the auto-responder doesn't send. I've tested each piece seperately and they both work but nor when I put them into the same file. I am very new to ASP and need some help! Thanks.

Here is the relevent code:

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = true
Response.Expires = -1000
Dim JMail, emailmsg, thing, msg
%>




<%
' Amend the Recipient, Subject and redirected page below.
if (Request.Form("Submit")) = "Submit Request" then
emailmsg = ""
emailmsg = emailmsg & "Name=" & request.form("Name") & vbcrlf
emailmsg = emailmsg & "CompanyName=" & request.form("CompanyName") & vbcrlf
emailmsg = emailmsg & "Address1=" & request.form("Address1") & vbcrlf
emailmsg = emailmsg & "Address2=" & request.form("Address2") & vbcrlf
emailmsg = emailmsg & "Postcode=" & request.form("Postcode") & vbcrlf
emailmsg = emailmsg & "DaytimeNumber=" & request.form("DaytimeNumber") & vbcrlf
emailmsg = emailmsg & "EveningNumber=" & request.form("EveningNumber") & vbcrlf
emailmsg = emailmsg & "MobileNumber=" & request.form("MobileNumber") & vbcrlf
emailmsg = emailmsg & request.form("Email") & vbcrlf
emailmsg = emailmsg & "Fax=" & request.form("Fax") & vbcrlf
emailmsg = emailmsg & "DomesticEnquiry=" & request.form("DomesticEnquiry") & vbcrlf
emailmsg = emailmsg & "CommericalEnquiry=" & request.form("CommericalEnquiry") & vbcrlf
emailmsg = emailmsg & "IndustrialEnquiry=" & request.form("IndustrialEnquiry") & vbcrlf
emailmsg = emailmsg & "NewBuildEnquiry=" & request.form("NewBuildEnquiry") & vbcrlf
emailmsg = emailmsg & "MainContractorEnquiry=" & request.form("MainContractorEnquiry") & vbcrlf
emailmsg = emailmsg & "SubContractorEnquiry=" & request.form("SubContractorEnquiry") & vbcrlf
emailmsg = emailmsg & "AdditionalNotes=" & request.form("AdditionalNotes") & vbcrlf
emailmsg = emailmsg & "How_Hear=" & request.form("How_Hear") & vbcrlf

set msg = Server.CreateOBject( "JMail.Message" )
msg.Logging = true
msg.silent = false
msg.From = request.form("email")
msg.AddRecipient xxx@emailaddress 'Recipient of emailed form
msg.Subject = "Contact Form" 'Subject of Email
msg.Body = cstr(EmailMsg)
msg.Send( "www15.redstation.co.uk" ) 'Change this to www2, www3 etc
response.redirect "thankyou.htm" 'address of thank you page

emailmsg = ""
emailmsg = emailmsg & request.form("Name") & vbcrlf
emailmsg = emailmsg & request.form("Address1") & vbcrlf
emailmsg = emailmsg & request.form("Address2") & vbcrlf
emailmsg = emailmsg & request.form("Postcode") & vbcrlf & vbcrlf
emailmsg = emailmsg & "Thank you for completing the web application form. We would" & vbcrlf

set msg = Server.CreateOBject( "JMail.Message" )
msg.Logging = true
msg.silent = false
msg.From = xxx@emailaddress 'Company email address
msg.AddRecipient request.form("email")
msg.Subject = "Thank you for your application" 'Subject of Email
msg.Body = cstr(EmailMsg)
msg.Send( "www15.redstation.co.uk" ) 'Change this to www2, www3 etc
response.redirect "thankyou.htm" 'address of thank you page
end if

%>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Location: Plymouth, UK
Posts: 79
Reputation: msaqib is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: ASP help for newbie

  #2  
May 26th, 2006
Now what you haev to do is, just create an asp page with the name "SendEmail.asp" and save it. Then create an HTML form and in the action property of the form <form action="SendEmail.aso" Method="Post">. And thats it. You are done.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 12:01 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC