-
Simple e-mail form
Hello! I want to make a e-mail form with a simple code. This code I want to use it into my personal web page. If there is anyone who can help me please put here a simple code. Please help me with this 'cause I am a beginner into ASP and I want to learn this.:(
-
ASP.NET makes it easy to send e-mails from a web server. For example if you have an Apply button, and 3 textboxes the user fills in. On the button click event, you could have for example...
Private Sub cmdApply_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Dim NewMessage As New System.Web.Mail.MailMessage()
NewMessage.To = txtTo.Text
NewMessage.From = "[email protected]"
NewMessage.Subject = txtSubject.Text
NewMessage.Body = txtBody.Text
System.Web.Mail.SmtpMail.Send(NewMessage)
End Sub
Of course there's no validation shown here, but its a starting point.