A summary description of Namespace Tmail {///
MailMessage _MailMessage = new MailMessage (); string UserName = "drk928"; string PassWord = "horse"; string EmailServer = "smtp.163.com"; protected System.Web.UI.WebControls.Button Button1; string EmailTo = "drk928 @ 21cn.com "; Private Void Page_Load (Object Sender, System.EventArgs E) {// Place the user code here to initialize the page} private bool sendvalid () {this._mailmessage.fields [" http: // Schemas. Microsoft.com/cdo/configuration/sendusing "] = 2; if (this.username! = null && this.password! = null) {this._mailmessage.fields [" http://schemas.microsoft.com/cDo/ configuration / smtpauthenticate "] = 1; this._MailMessage.Fields [" http://schemas.microsoft.com/cdo/configuration/sendusername "] = this.UserName; this._MailMessage.Fields [" http: // schemas. microsoft.com/cdo/configuration/sendpassword "] = this.PassWord;} this._MailMessage.To = this.EmailTo; SmtpMail.SmtpServer = this.EmailServer; try {SmtpMail.Send (this._MailMessage);} catch (Exception EX) {//this.writel OGTXT ("ErrorMessage:" EX.MESSAGE, FALSE); Return False;}} #region Web Form Designer generated code override protected void oninit (Eventargs e) {// // codegen: This call is ASP.NET Web Form Designer is required. // InitializeComponent (); base.onit (e);} ///