using System; using System.Collections.Generic; using System.Text; namespace Apewer.Network { /// 扩展方法。 public static class Extension { /// 添加邮件账户。 public static void Add(this List value, string address, string name) { if (value == null) return; value.Add(new MailAddress(address, name)); } /// 添加邮件账户。 public static void Add(this List value, string address) { if (value == null) return; value.Add(new MailAddress(address)); } /// 发送邮件。 public static MailRecord Send(this MailClient value, MailMessage message) { return MailMethods.Send(value, message); } /// 发送邮件。 public static MailRecord Send(this MailClient value, string sender, string receiver, string content = null, string title = null) { return MailMethods.Send(value, sender, receiver, content, title); } } }