Imports System.Web.Mail
Public Class index
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents txtTo As System.Web.UI.WebControls.TextBox
Protected WithEvents txtFrom As System.Web.UI.WebControls.TextBox
Protected WithEvents txtSubject As System.Web.UI.WebControls.TextBox
Protected WithEvents txtBody As System.Web.UI.WebControls.TextBox
Protected WithEvents btnSend As System.Web.UI.WebControls.Button
Protected WithEvents lbStatus As System.Web.UI.WebControls.Label
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnSend.Click
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text)
lbStatus.Text = "Message Sent"
End Sub
End Class
|