Imports System.Web.Mail Partial Class contactus2 Inherits System.Web.UI.Page Dim code1 As New SuperClass Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim found As Boolean If Not Page.IsPostBack Then code1.select_Email(1, Hidden1.Value, found) End If If Request.QueryString("for") = "seg" Then txtsubject.Text = "suggest name" End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Server.Transfer("Contactus.aspx") End Sub Protected Sub cmdSent_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSent.Click Dim objEmail As New MailMessage objEmail.To = "info@alsaraf.com.kw" 'Hidden1.Value objEmail.From = txtEmail.Text objEmail.Subject = txtsubject.Text Dim bd As String bd = "" bd &= "Name : " & txtname.Text & "
" bd &= "Email : " & txtEmail.Text & "
" bd &= "Phone : " & txtsubject.Text & "
" bd &= "Comment: " & "
" bd &= txtBody.Text bd &= "" objEmail.Body = bd objEmail.BodyEncoding = System.Text.Encoding.GetEncoding("windows-1256") objEmail.BodyFormat = MailFormat.Html objEmail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 objEmail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "webmaster@VIRGINIA-DENTALCENTER.COM" objEmail.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "webmaster" SmtpMail.SmtpServer = "mail.VIRGINIA-DENTALCENTER.COM" Try SmtpMail.Send(objEmail) msg1.Text = "Thank you! Your message has been sent to management. We'll send you a response shortly." txtBody.Text = "-" txtEmail.Text = "-" txtsubject.Text = "-" Catch exc As Exception msg1.Text = "check by phone" & exc.Message End Try End Sub End Class