本文整理汇总了C#中Email.AddTo方法的典型用法代码示例。如果您正苦于以下问题:C# Email.AddTo方法的具体用法?C# Email.AddTo怎么用?C# Email.AddTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email.AddTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillMail
private static bool FillMail(List<string> EmailReceive, string SubjectEmail, List<string> PathAttachment, ref Email Mail)
{
if (EmailReceive == null)
return false;
for (int i = 0; i < EmailReceive.Count; i++)
if (!Mail.AddTo("", EmailReceive[i]))
return false;
Mail.Subject = SubjectEmail;
if (PathAttachment != null)
for (int i = 0; i < PathAttachment.Count; i++)
Mail.AddFileAttachment(PathAttachment[i]);
return true;
}
示例2: smtpAuthentication
public static bool smtpAuthentication(string hostSMTP, int portSMTP, string userName, string password)
{
MailMan smtpTest = new MailMan();
smtpTest.SmtpHost = hostSMTP;
smtpTest.SmtpPort = portSMTP;
smtpTest.SmtpUsername = userName;
smtpTest.SmtpPassword = password;
if (SSL)
smtpTest.PopSsl = true;
else
smtpTest.PopSsl = false;
Email mail = new Email();
mail.From = userName;
mail.AddTo("", userName);
mail.Subject = "Test mail";
mail.SetHtmlBody("<html><body><b><font color='red' size='+1'>Thư kiểm tra</font></b></html>");
if (smtpTest.SendEmail(mail))
return true;
else
return false;
}