i am developing a web application and would like to sent an email from it.hw do i do it.the following is my code.where did i go wrong as it does not work
code:--
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim emailMessage As System.Web.Mail.MailMessage
Dim content As String
Dim s As System.Web.Mail.SmtpMail
content = "your user id is" + TextBox1.Text + " and your password is " + TextBox7.Text
emailMessage = New System.Web.Mail.MailMessage
emailMessage.From = TextBox8.Text
emailMessage.To = TextBox7.Text
emailMessage.Subject = "your user id and password"
emailMessage.Body = content
'SmtpMail.SmtpServer = "localhost"
s.SmtpServer = "localhost"
Try
'SmtpMail.Send(emailMessage)
s.Send(emailMessage)
Response.Write("<script>alert('MESSAGE SENT');</script>")
' labelStatus.Text = "Message sent!"
' buttonSend.Enabled = False
Catch ex As Exception
'labelStatus.Text = "Unable to send the e-mail message"
Response.Write("<script>alert('Unable to send the e-mail message');</script>")
End Try
End Sub