Mimorkeris
06-02-2005, 03:08 AM
I downloaded 2 ASP pages from my ISP to allow visitors to website to send Emails whilst keeping address hidden (well at least atempt to).
They work OK, but, the form which sends the email then advises the visitor if it was sent or not very crudely.
I would like to be able to open/load a new page which is more informative, but I my knowledge of ASP is very limited, so any help would be greatly appreciated.
The other thing that springs to mind is - how do I carry forward the the data from the either the previous or this page page to the next?
Here is the code from the page: -
<html>
<head>
<title>ASPSend mail example</title>
</head>
<body>
<%
'Getting (Requesting) the Session variables from Form on previous page
Session("FromName") = Request("FromName")
Session("FromAddress") = Request("FromAddress")
Session("Subject") = Request("Subject")
Session("BodyText") = Request("BodyText")
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
'Setting variables
Mailer.FromName = Session("FromName")
Mailer.FromAddress = Session("FromAddress")
Mailer.RemoteHost = "smtpmail.activeisp.com"
Mailer.AddRecipient "Mail Recipient", "admin@acompany.com"
Mailer.Subject = Session("Subject")
Mailer.BodyText = Session("BodyText")
'Checking if mail sent ok, if not display error message
if Mailer.SendMail then
Response.Write "Thank you for contacting us, we will respond within the next working day."
Response.Write "Do not respond to this automated message."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
'Abandoning session variables
Session.Abandon
%>
</body>
</html>
They work OK, but, the form which sends the email then advises the visitor if it was sent or not very crudely.
I would like to be able to open/load a new page which is more informative, but I my knowledge of ASP is very limited, so any help would be greatly appreciated.
The other thing that springs to mind is - how do I carry forward the the data from the either the previous or this page page to the next?
Here is the code from the page: -
<html>
<head>
<title>ASPSend mail example</title>
</head>
<body>
<%
'Getting (Requesting) the Session variables from Form on previous page
Session("FromName") = Request("FromName")
Session("FromAddress") = Request("FromAddress")
Session("Subject") = Request("Subject")
Session("BodyText") = Request("BodyText")
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
'Setting variables
Mailer.FromName = Session("FromName")
Mailer.FromAddress = Session("FromAddress")
Mailer.RemoteHost = "smtpmail.activeisp.com"
Mailer.AddRecipient "Mail Recipient", "admin@acompany.com"
Mailer.Subject = Session("Subject")
Mailer.BodyText = Session("BodyText")
'Checking if mail sent ok, if not display error message
if Mailer.SendMail then
Response.Write "Thank you for contacting us, we will respond within the next working day."
Response.Write "Do not respond to this automated message."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
'Abandoning session variables
Session.Abandon
%>
</body>
</html>