Having transferred our site to BT, the contact forms no longer work. When a user pressed submit, an email was sent to both us and the user.
We have Advanced Web Hostin so .asp works fine.
This is most of the relevant part of the code:
Set Mail=CreateObject("CDO.Message")
Mail.Subject=subject
Mail.From="enquiries@ourdomain.co.uk"
Mail.To=toMail
Mail.HTMLBody=html
'Mail.Queue = True
'Mail.Send
' 'set Mail=nothing
'
'
' Set Mail = Server.CreateObject("Persits.MailSender")
'
' mail.Host = "mail.cro.net"
' 'Mail.From = "enquiries@ourdomain.co.uk"
' Mail.From = "igor@ourwebdesigner.hr"
' Mail.FromName = "contact form"
' Mail.AddAddress toMail
' Mail.Subject = subject
' Mail.Body = html
' Mail.IsHTML = True
On Error Resume Next
Mail.Send
Set Mail2=CreateObject("CDO.Message")
Mail2.Subject=subject
Mail2.From="enquiries@ourdomain.co.uk"
Mail2.To=email
Mail2.HTMLBody=html2
Mail2.Queue = True
' Set Mail2 = Server.CreateObject("Persits.MailSender")
' Mail2.Host = "mail.cro.net"
' 'Mail2.From = "enquiries@ourdomain.co.uk"
' Mail2.From = "igor@ourwebdesigner.hr"
' Mail2.FromName = "contact form"
' Mail2.AddAddress email
' Mail2.Subject = subject
' Mail2.Body = html2
' Mail2.IsHTML = True
On Error Resume Next
Mail2.Send
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
response.end
set Mail = nothing
set Mail2 = nothing
else
%>
<script>
alert('Thank you for your enquiry. It has been sent successfully');
</script>
<%
set Mail = nothing
set Mail2 = nothing
response.Redirect("" & Request.ServerVariables("SCRIPT_NAME") & "?cmd=ok")
end if
end if
Can anyone tell from the above why emails would no longer work? Thanks
Solved! Go to Solution.
That's not our old server - i think its the old settings of the web designers initial test server. There's two big block of code there that have been commented out.
Just read this post http://btb.lithium.com/btb/board/message?board.id=Webhosting&message.id=828&query.id=629453#M828
and seems like you cant sent mail out from a site. I find that hard to believe given it's such a basic requirement these days.
' mail.Host = "mail.cro.net"
For a start, the mail host is still pointing to your old server. Try changing this to "localhost"
That's not our old server - i think its the old settings of the web designers initial test server. There's two big block of code there that have been commented out.
Just read this post http://btb.lithium.com/btb/board/message?board.id=Webhosting&message.id=828&query.id=629453#M828
and seems like you cant sent mail out from a site. I find that hard to believe given it's such a basic requirement these days.