日期:2008-11-18  浏览次数:20549 次

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Blood.Com.ClassLib;

namespace Test
{
    /// <summary>
    /// 邮件发送例子
    /// </summary>
    public class SendMailSample : System.Web.UI.Page
    {
        protected System.Web.UI.WebControls.DataGrid DataGrid1;
        protected System.Web.UI.WebControls.DropDownList ddlPriority;
        protected System.Web.UI.WebControls.DropDownList ddlHtml;
        protected System.Web.UI.WebControls.TextBox txtSmtpHost;
        protected System.Web.UI.WebControls.TextBox txtPort;
        protected System.Web.UI.WebControls.TextBox txtFrom;
        protected System.Web.UI.WebControls.TextBox txtFromName;
        protected System.Web.UI.WebControls.TextBox txtTo;
        protected System.Web.UI.WebControls.TextBox txtToName;
        protected System.Web.UI.WebControls.TextBox txtSubject;
        protected System.Web.UI.WebControls.TextBox txtMessage;
        protected System.Web.UI.WebControls.RegularExpressionValidator revPort;
        protected System.Web.UI.WebControls.RequiredFieldValidator rfvSmtpHost;
        protected System.Web.UI.WebControls.RequiredFieldValidator rfvPort;
        protected System.Web.UI.WebControls.RequiredFieldValidator rfvFrom;
        protected System.Web.UI.WebControls.RequiredFieldValidator rfvTo;
        protected System.Web.UI.WebControls.RequiredFieldValidator rfvSubject;
        protected System.Web.UI.WebControls.RequiredFieldValidator rfvMessage;
        protected System.Web.UI.WebControls.Button btnSendMail;
        protected System.Web.UI.WebControls.Label lblMessage;
        protected System.Web.UI.WebControls.RegularExpressionValidator revFrom;
        protected System.Web.UI.WebControls.RegularExpressionValidator revTo;
        protected System.Web.UI.WebControls.Panel pelMessage;
    
        private void Page_Load(object sender, System.EventArgs e)
        {
        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);