PDA

View Full Version : ASPMail Question


marcygiff
01-30-2007, 03:39 PM
I have designed a form on our site to email the information using ASPMail. I can get it to send an e-mail w/o the form objects but once I start putting the form objects in, it won't work.

THIS CODE WORKS AND AUTOMATICALLY REDIRECTS TO THE CONFIRMATION PAGE AND SENDS THE E-MAIL:
<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Website"
Mailer.FromAddress= "info@medflight.com"
Mailer.RemoteHost = "mail.medflight.com"
Mailer.AddRecipient "Marcy Gifford", "mgifford@medflight.com"
Mailer.Subject = "Contact from Website"
Mailer.BodyText = "Dear Stephen" & VbCrLf & "Blah, Blah, Blah,....!"
if Mailer.SendMail then
' Message sent Ok, redirect to a confirmation page
Response.Redirect ("http://www.medflight.com/education/educthanks.htm")
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>

BUT, WHEN I DO THE FOLLOWING TO SEND THE FORM OBJECTS, I GET A PAGE NOT FOUND ERROR:
<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = Request.Form(name)
Mailer.FromAddress = info@medflight.com
Mailer.RemoteHost = "mail.medflight.com"
Mailer.AddRecipient "Marcy Gifford", "mgifford@medflight.com"
Mailer.Subject = "Contact from Website"
strMsgInfo = "Name: " & Request.Form(name) & vbCrLf
strMsgInfo = strMsgInfo & "Department/Agency: " & Request.Form(agency) & vbCrLf
strMsgInfo = strMsgInfo & "E-mail Address: " & Request.Form(email_address) & vbCrLf
strMsgInfo = strMsgInfo & "Contact Phone: " & Request.Form(agency) & vbCrLf
strMsgInfo = strMsgInfo & "Requested Date: " & Request.Form(reqdate) & vbCrLf
strMsgInfo = strMsgInfo & "Number of Attendees: " & Request.Form(attendees) & vbCrLf
strMsgInfo = strMsgInfo & "Requested Time: " & Request.Form(reqtime) & vbCrLf
strMsgInfo = strMsgInfo & "Audience: " & Request.Form(audience) & vbCrLf
strMsgInfo = strMsgInfo & "Comments: " & Request.Form(comments) & vbCrLf

strMsgHeader = "Form information follows" & vbCrLf & "Your submission has been forwarded to our Education staff. Someone will respond to your request within 5-7 business days. Thank you for your interest in MedFlight's Education Center."
strMsgFooter = vbCrLf & "NOTICE TO RECIPIENT: This e-mail is meant for only the intended recipient of the transmission, and may be a communication privileged by law. If you received this e-mail in error, any review, use, dissemination, distribution, or copying of this e-mail is strictly prohibited. Please notify us immediately of the error by return e-mail and please delete this message from your system. Thank you in advance for your cooperation."
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
' Message sent Ok, redirect to a confirmation page
Response.Redirect ("http://www.medflight.com/education/educthanks.htm")
else
' Message send failure
Response.Write ("An error has occurred.<BR>")
' Send error message
Response.Write ("The error was " & Mailer.Response)
end if
%>

WHAT AM I MISSING HERE????