SmtpServerHelper.cs

(开头部分) 27KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.IO;
using System.Net.Sockets;
using System.Collections;

public enum MailFormat { Text, HTML };
public enum MailPriority { Low = 1, Normal = 3, High = 5 };

/// <summary>
/// 添加附件
/// </summary>
public class MailAttachments
{
    #region 构造函数
    public MailAttachments()
    {
        _Attachments = new ArrayList();
    }
    #endregion

    #region 私有字段
    private IList _Attachments;
    private const int MaxAttachmentNum = 10;
    #endregion

    #region 索引器
    public string this[int index]
    {
        get { return (string)_Attachments[index]; }
    }
    #endregion

    #region 公共方法
    /// <summary>
    /// 添加邮件附件
    /// </summary>
    /// <param name="FilePath">附件的绝对路径</param>
    public void Add(params string[] filePath)
    {
        if (filePath == null)
        {
            throw (new ArgumentNullException("非法的附件"));
        }
        else
        {
            for (int i = 0; i < filePath.Length; i++)
            {
                Add(filePath[i]);
            }
        }
    }

    /// <summary>
    /// 添加一个附件,当指定的附件不存在时,忽略该附件,不产生异常。
    /// </summary>
    /// <param name="filePath">附件的绝对路径</param>
    public void Add(string filePath)
    {
        if (System.IO.File.Exists(filePath))
后面还有 864 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。