Hi there,
I would like some information about ASP.NET contact form. I created one of my web page, and i used VB.NET to write the script.
When i try to submit, i've got no errors, it seems to work, but i never receive the message in my mail box afterwards... I'm wondering why!
Here is my code in VB.NET:
Please someone help me
Yann
I would like some information about ASP.NET contact form. I created one of my web page, and i used VB.NET to write the script.
When i try to submit, i've got no errors, it seems to work, but i never receive the message in my mail box afterwards... I'm wondering why!
Here is my code in VB.NET:
Code:
Imports System.Net.Mail
Partial Class _Default
Inherits System.Web.UI.Page
Sub Submit(ByVal Source As Object, ByVal e As EventArgs)
Dim mailMessage As New MailMessage()
mailMessage.From = New MailAddress(txtMail.Text)
mailMessage.To.Add("yannh@hotmail.com")
mailMessage.Subject = txtSubject.Text
mailMessage.IsBodyHtml = False
mailMessage.Body = txtBody.Text
mailMessage.Priority = MailPriority.Normal
Dim smtp As New SmtpClient ("mail.yannhuet.co.cc")
smtp.Host = "mail.yannhuet.co.cc"
smtp.Send(mailMessage)
lblResponse.Text = "Your email has been sent."
End Sub
End Class
Please someone help me
Yann