/// <summary> /// 创建任意电子邮件客户端 /// </summary> /// <param name="Smtp">指定连接Smtp服务器的方式</param> /// <param name="IMAP">指定连接IMAP服务器的方式</param> /// <param name="credentials">用来登录邮件服务器的凭据,用户名末尾不需要加上@和域名</param> /// <param name="DomainName">用户名的域名,不需要加上@符号</param> /// <param name="CheckInterval">指定用来检查新邮件的间隔, /// 如果为<see langword="null"/>,默认为1分钟</param> /// <returns></returns> public static IMailClient Client(ConnectionInfo Smtp, ConnectionInfo IMAP, UnsafeCredentials credentials, string DomainName, TimeSpan?CheckInterval = null) => Client(Smtp, IMAP, new($"{credentials.ID}@{DomainName}", credentials.Password), CheckInterval);
/// <summary> /// 创建任意电子邮件客户端 /// </summary> /// <param name="Smtp">指定连接Smtp服务器的方式</param> /// <param name="IMAP">指定连接IMAP服务器的方式</param> /// <param name="credentials">用来登录邮件服务器的凭据,需要指定完整的用户名,包含@和邮箱域名</param> /// <param name="CheckInterval">指定用来检查新邮件的间隔, /// 如果为<see langword="null"/>,默认为1分钟</param> /// <returns></returns> public static IMailClient Client(ConnectionInfo Smtp, ConnectionInfo IMAP, UnsafeCredentials credentials, TimeSpan?CheckInterval = null) => new MailClient(Smtp, IMAP, credentials, CheckInterval);