public SendEmail ( String from, String fromEmail, IEnumerable |
||
from | String | From. |
fromEmail | String | From email. |
toEmails | IEnumerable |
To emails. |
ccEmails | IEnumerable |
The cc emails. |
bccEmails | IEnumerable |
The BCC emails. |
subject | String | The subject. |
text | String | The text. |
attach | System.Net.Mail.Attachment | The attach. |
isHtmlFormat | bool | if set to |
Результат | bool |
/// <summary> /// Sends mails to list of recipients specified in MailAddressCollection. /// </summary> /// <returns></returns> public bool SendMails() { var mailer = new EmailSender(SmtpHost, SmtpUser, SmtpPassword); if (mailer.SendEmail(from, fromEmail, mailAddressCollection, subject, Body, Attachments, IsHtmlFormat)) { return true; } return false; }
/// <summary> /// Send email. /// </summary> /// <param name="smtpHost">The SMTP host.</param> /// <param name="user">The SMTP user.</param> /// <param name="password">The SMTP password.</param> /// <returns></returns> public bool Send(String smtpHost, String user, String password) { var mailer = new EmailSender(smtpHost, user, password); if (mailer.SendEmail(from, fromEmail, to, toEmail, subject, Body, Attachments, IsHtmlFormat)) { return true; } return false; }