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;
Using the above, the following error is shown;
So I removed part of the problem, so it read;
Now I receive this;
Thanks in advance!
Oli
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 = "<html><head></head><body bgcolor=#000000>"
strMessage = strMessage & "<font face=verdana,arial size=3 color=#CC0000>"
strMessage = strMessage & "<b>Proud To Have Met You<br /> - Contact Form</b><br /><br />"
strMessage = strMessage & "</font>"
strMessage = strMessage & "<font face=verdana,arial size=2 color=#FFFFFF>"
strMessage = strMessage & "Name : " & Request.Form("name") & "<br />"
strMessage = strMessage & "Email : " & Request.Form("email") & "<br />"
strMessage = strMessage & "Subject : " & Request.Form("subject") & "<br /><br />"
strMessage = strMessage & "Info : " & Request.Form("info") & ""
strMessage = strMessage & "</font>"
strMessage = strMessage & "</body></html>"
' 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="[email protected]"][email protected][/email]
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
%>
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="[email protected]"][email protected][/email]
------------------------------------------------------------^
So I removed part of the problem, so it read;
Code:
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]
Thanks in advance!
Oli