I apologise if this has been posted before, but I did a quick search and couldn’t find an answer.
I have an email form on my website, which worked on my old host, but doesn’t seem to work here (which was expected due to server changes etc), and wondered if anyone could take a look at it for me please, and tell me where I’m going wrong;
[CODE]<%
If Request.Form(“btnSubmit”).Count > 0 Then
’ Create the message for the email
strMessage = “”
strMessage = strMessage & “”
strMessage = strMessage & “Proud To Have Met You
- Contact Form
”
strMessage = strMessage & “”
strMessage = strMessage & “”
strMessage = strMessage & "Name : " & Request.Form(“name”) & “
”
strMessage = strMessage & "Email : " & Request.Form(“email”) & “
”
strMessage = strMessage & "Subject : " & Request.Form(“subject”) & “
”
strMessage = strMessage & "Info : " & Request.Form(“info”) & “”
strMessage = strMessage & “”
strMessage = strMessage & “”
’ Create email object and set all the values, setting the from address to be the person who filled in the form
Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)
Mailer.FromName = Request.Form(“name”)
Mailer.FromAddress= Request.Form(“email”)
Mailer.RemoteHost = “mail.domainname.co.uk”
Mailer.AddRecipient = “Proud To Have Met You”, [email protected]
Mailer.Subject = “Proud To Have Met You - Contact Form”
Mailer.ContentType = “text/html”
Mailer.BodyText = strMessage
’ Send the mail and tidy up
if Mailer.SendMail then
’ Redirect to thankyou page
Response.Redirect “thankyou.htm”
else
Response.Write "Mail send failure. Error was " & Mailer.Response
End If
End If
%>
[/CODE]
Using the above, the following error is shown;
[CODE]Microsoft VBScript compilation [font=Arial][size=2]error ‘800a0401’[/size][/font]
[font=Arial][size=2]Expected end of statement[/size][/font]
[font=Arial][size=2]/email.asp[/size][/font][font=Arial][size=2], line 22[/size][/font] Mailer.AddRecipient = “Proud To Have Met You”, [email protected]
------------------------------------------------------------[1]
So I removed part of the problem, so it read;
Mailer.AddRecipient = [email="[email protected]"][email protected][/email]
Now I receive this;
[CODE]Microsoft VBScript runtime [font=Arial][size=2]error ‘800a01b6’[/size][/font]
[font=Arial][size=2]Object doesn’t support this property or method: ‘Mailer.AddRecipient’[/size][/font]
[font=Arial][/font]
[font=Arial][size=2]/email.asp[/size][/font][font=Arial][size=2], line 22[/size][/font]
[/CODE]
Thanks in advance!
Oli
/CODE ↩︎