instead of Response.write "Message sent successfully!"
use response.redirect("thanks.
and make sure to put at the top of the page
<%response.buffer=true%>
Main Topics
Browse All TopicsHi,
I have form pages and they are sent using jmail.asp files. When the form submitted the sender ends up with a "message sent successfully" text. But I want the screen to be redirected to a thanks.htm page. I include jmail.asp code. Remove message sent successfully text and redirect it to thanks.htm. I hope you can do it. Thanks,
<html>
<body>
<%
' mail object
set msg = Server.CreateOBject( "JMail.Message" )
' logging for debugging, silent for errors
msg.Logging = true
msg.silent = true
' sender
msg.From = "info@xxxxxxx.com"
msg.FromName = "Free exhibition ticket request"
' recipients
msg.AddRecipient request.form("recipient")
'msg.AddRecipientBCC "",""
' subject
msg.Subject = request.form("subject")
'HTML email
msg.HTMLBody = "<html><body><font face=""verdana"" color=""navy"">Name</font>
msg.appendHTML request.form("name") & "<br>"
msg.appendHTML "<html><body><font face=""verdana"" color=""navy"">Phone</font
msg.appendHTML request.form("Phone") & "<br>"
msg.appendHTML "<html><body><font face=""verdana"" color=""navy"">Email</font
msg.appendHTML request.form("Email") & "<br>"
msg.appendHTML "<html><body><font face=""verdana"" color=""navy"">Exhibition<
msg.appendHTML request.form("Exhibition")
msg.appendHTML "<html><body><font face=""verdana"" color=""navy"">Address</fo
msg.appendHTML request.form("Address") & "<br>"
msg.appendHTML "<html><body><font face=""verdana"" color=""navy"">Comments</f
msg.appendHTML request.form("comments")
' create message and add to it
'msg.Body = "Hello," & vbCrLf & vbCrLf & "This is a test."
'msg.AppendText vbCrLf & "Sincerely," & vbCrLf & vbCrLf & "The Web Site"
'add attachment
'(this properties are disable on our servers)
'msg.AddAttachment (Server.MapPath("Media\Ber
'msg.AddCustomAttachment "phrases.txt","This is the first phrase" & VbCrLf & "And this is the second phrase" & VbCrLf
'msg.AddURLAttachment "http://www.net-language.c
'msg.AppendBodyFromFile Server.MapPath("readmetest
'msg.GetMessageBodyFromURL
'msg.ExtractEmailAddresses
' send message and capture errors
if not msg.Send("mail.xxxxxxx.com
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent successfully!"
end if
'close connection
'close everything
'msg.Disconnect
Set msg = Nothing
%>
</body>
</html>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: cyberwebservicePosted on 2006-08-25 at 01:03:11ID: 17387588
Response.redirect("thanks. htm")
This is what you want?