You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

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