MarcusStringer
IS-IT--Management
Hi Guys and Girls.
I have a form which the client fills out and when they hit Submit it sends and email (HTML versionof the form) to me...This has been working great for years...
Now they want me to add their address as well so it sends to not only me but also to them.
I've added a email section into both the ASP form and HTML form and it works great, only problem is I can't get Jmail to take the value from the client email address...(if that makes sense)
Here's my code with the JMail at the bottom
Marcus
I have a form which the client fills out and when they hit Submit it sends and email (HTML versionof the form) to me...This has been working great for years...
Now they want me to add their address as well so it sends to not only me but also to them.
I've added a email section into both the ASP form and HTML form and it works great, only problem is I can't get Jmail to take the value from the client email address...(if that makes sense)
Here's my code with the JMail at the bottom
Code:
<%
Function getCheckVal(inVal)
if request.form(inVal)<>"" then
getCheckVal="[X] "
else
getCheckVal="[ ] "
end if
End Function
Function getRadioVal(inVal,compVal)
if LCase(request.form(inVal))=LCase(compVal) then
getRadioVal="[X] "
else
getRadioVal="[ ] "
end if
End Function
[b]
bodyText=bodyText&" <td colspan=""2"">Email:"
bodyText=bodyText&" "
bodyText=bodyText&" "&request.form("email")&"</td>"
[/b]
DIM strEmail
strEmail = request.form("email")
Set JMail = Server.CreateObject ("JMail.SMTPMail")
JMail.ServerAddress = "localhost"
JMail.Sender = "admin@someemail.com.au"
JMail.Subject = "Online request for information"
JMail.AddRecipient "me@someemail.com.au"
JMail.AddRecipient = strEmail
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.ContentType = "text/html"
JMail.Priority = 1
JMail.AppendText("<html>")
JMail.AppendText(bodyText)
JMail.AppendText("</html>")
On Error Resume Next
JMail.execute
if err then response.redirect("emailFailed.asp") else response.redirect("emailSucceeded.asp")
%>
Marcus