Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
- Try
- Dim SmtpServer As New SmtpClient()
- Dim mail As New MailMessage()
- SmtpServer.Credentials = New Net.NetworkCredential("xxxx@gmail.com", "xxxxx")
- SmtpServer.Port = 587
- SmtpServer.Host = "smtp.gmail.com"
- SmtpServer.EnableSsl = True
- mail = New MailMessage()
- mail.From = New MailAddress(TextBox2.Text, "Tourism")
- mail.ReplyTo = New MailAddress(TextBox2.Text)
- mail.To.Add("xxxx@gmail.com")
- mail.Subject = "UTTARAKHAND TOURISM : QUICK CONTACT QUERY"
- mail.Body = "<B>" + "||| -- UTTARAKHAND TOURISM : QUICK CONTACT QUERY -- |||" + "</B>" + "<BR><BR><BR>" + "<B>" + "Client Name : " + "</B>" & " " & TextBox1.Text + "<BR><BR>" + "<B>" + "Email : " + "</B>" & " " & TextBox2.Text + "<BR><BR>" + "<B>" + "Mobile No. : " + "</B>" & " " & TextBox3.Text + "<BR><BR>" + "<B>" + "City : " + "</B>" & " " & TextBox4.Text + "<BR><BR>" + "<B>" + "Country : " + "</B>" & " " & DropDownList1.SelectedItem.Text + "<BR><BR>" + "<B>" + "Query Regarding : " + "</B>" & " " & TextBox6.Text + "<BR><BR>" + "<B>" + "Query : " + "</B>" & " " & TextBox7.Text + "<BR><BR>"
- mail.IsBodyHtml = True
- SmtpServer.Send(mail)
- Label8.Visible = True
- Catch ex As Exception
- MsgBox(ex.ToString)
- End Try
- TextBox1.Text = ""
- TextBox2.Text = ""
- TextBox2.Text = ""
- TextBox3.Text = ""
- TextBox4.Text = ""
- DropDownList1.SelectedItem.Text = "Select Country"
- TextBox6.Text = ""
- TextBox7.Text = ""
- End Sub
- Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
- Response.Redirect(Request.Url.AbsoluteUri)
- End Sub
- End Class
- Server Error in '/' Application.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement