Components ASP.Net

<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Web.Mail" %>

Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
    Dim TheMailMessage as New MailMessage
    Dim TheMailConnection as SmtpMail
    TheMailMessage.From = txtFromEmail.Text
    TheMailMessage.To = txtToEmail.Text
    TheMailMessage.Subject = txtSubject.Text
    TheMailMessage.Body = txtMessage.Text
    TheMailConnection.Send(TheMailMessage)
End Sub



Sending a Simple Email Message in Code





Enter your email address:
    id="txtFromEmail"
    runat="server"
/>


Enter the to email address:
    id="txtToEmail"
    runat="server"
/>


Enter the subject of your message:
    id="txtSubject"
    runat="server"
/>


Enter the text of your message:
    id="txtMessage"
    runat="server"
    textmode="MultiLine"
    rows="5"
/>


    id="butOK"
    text="Send"
    Type="Submit"
    OnClick="SubmitBtn_Click" 
    runat="server"
/>