当前位置:编程学习 > C#/ASP.NET >>

C#.NET发EMAIL的几种方法 MailMessage/SmtpClient/CDO.Message

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Net.Mail;
using System.Net;

namespace Pub.Class
{
    /// <summary>
    /// 发送Email类
    /// </summary>
    public class Email
    {
        #region 私有成员
        private static object lockHelper = new object();
        private string _From;
        private string _FromEmail;
        private string _Subject;
        private string _Body;
        private string _SmtpServer;
        private string _SmtpPort = "25";
        private string _SmtpUserName;
        private string _SmtpPassword;
        private System.Web.Mail.MailFormat _Format = System.Web.Mail.MailFormat.Html;
        private System.Text.Encoding _Encoding = System.Text.Encoding.Default;
        #endregion

        #region 属性
        /// <summary>
        /// 正文内容类型
        /// </summary>
        public System.Web.Mail.MailFormat Format { set { _Format = value; } }
        /// <summary>
        /// 正文内容编码
        /// </summary>
        public System.Text.Encoding Encoding { set<

补充:软件开发 , C# ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,