Imports System.Web.Mail Partial Class contactus Inherits System.Web.UI.Page Dim code1 As New SuperClass Public title, body, arabictitle, arabicbody As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim found As Boolean code1.selectmain(Title, arabictitle, body, arabicbody, 5) If Not Page.IsPostBack Then code1.select_Email(1, Hidden1.Value, found) 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 = Hidden1.Value objEmail.From = txtEmail.Text objEmail.Subject = txtsubject.Text Dim bd As String bd = "" bd &= "الغرض : " & DropDownList1.SelectedItem.Text & "
" bd &= "الاسم : " & txtname.Text & "
" bd &= "الايميل : " & txtEmail.Text & "
" bd &= "الهاتف : " & txtsubject.Text & "
" bd &= "ملاحظة: " & "
" 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@q8rental.COM" objEmail.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "webmaster" SmtpMail.SmtpServer = "mail.q8rental.COM" Try SmtpMail.Send(objEmail) msg1.Text = "Thank you for your query; we will be answering you ASAP" txtBody.Text = "-" txtEmail.Text = "-" txtsubject.Text = "-" Catch exc As Exception msg1.Text = "check by phone" & exc.Message End Try End Sub End Class