Hi
I have had 6 different support chats since 13th April, trying to get a test contact form working, without success. This script works on my current host, but not on webhosting UK servers. Today I've been told this won't work until DNS changes have been made to point mydomain.co.uk to the new webhosting UK server. To say I'm frustrated, is a massive understatement. Surely there is some way to test contact form from a temporary URL?
Code:
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' send email
Dim strBodyText As Object
'build email body
strBodyText = "Title: " & CTitle.Text & "<BR>"
strBodyText = strBodyText & "First Name: " & FirstName.Text & "<BR>"
strBodyText = strBodyText & "Surname: " & Surname.Text & "<BR>"
strBodyText = strBodyText & "Address: " & Address.Text & " " & Address2.Text & "<BR>"
strBodyText = strBodyText & "Telephone: " & Phone.Text & "<BR>"
strBodyText = strBodyText & "E-Mail: " & Email.Text & "<BR>"
strBodyText = strBodyText & "Message: " & Message.Text & "<BR>"
strBodyText = Replace(strBodyText, "'", "'")
Dim Msg As New System.Web.Mail.MailMessage
Dim SMTPServer = "mail.domain.com"
Msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", SMTPServer)
Msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
Msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 1)
Msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
Msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "me@mydomain.co.uk")
Msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password")
Msg.From = "Website <website@domain.co.uk>"
Msg.To = "Me <me@hotmail.com>"
'Msg.Cc = ""
Msg.Subject = "Test"
Msg.BodyEncoding = System.Text.Encoding.UTF8
Msg.BodyFormat = Web.Mail.MailFormat.Html
Msg.Body = strBodyText
System.Web.Mail.SmtpMail.SmtpServer = SMTPServer
System.Web.Mail.SmtpMail.Send(Msg)
Panel1.Visible = False
Panel2.Visible = True
End Sub
</script>