Imports System.Web.Mail Partial Class ForgetPass Inherits System.Web.UI.Page Dim code1 As New SuperClass Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim str As String str = code1.getmail(TextBox1.Text) If str <> "" Then Dim objEmail As New MailMessage objEmail.To = TextBox1.Text objEmail.From = "info@GOOGLCV.com" objEmail.Subject = "Al-Sarraf : Login information" objEmail.Body = "" & str & "" 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") = "admin1@alsaraf.com.kw" objEmail.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "admin1" SmtpMail.SmtpServer = "mail.alsaraf.com.kw" Try SmtpMail.Send(objEmail) msg1.Text = "your password sent to your email" Catch exc As Exception msg1.Text = "check by phone" & exc.Message End Try Else msg1.Text = "Undefined email" End If End Sub End Class