SendEmail() public method

Sends the email.
public SendEmail ( String from, String fromEmail, IEnumerable toEmails, IEnumerable ccEmails, IEnumerable bccEmails, String subject, String text, System.Net.Mail.Attachment attach, bool isHtmlFormat ) : bool
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 true [is HTML format].
return bool
Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
        }