/// <summary> /// Send an HTML email. /// </summary> /// <param name="from">A string representation of the email address used to send the email.</param> /// <param name="sender">A string representation of the email address which the email appears to be sent from.</param> /// <param name="to">A comma-delimited array of string representations of email addresses which the email should be sent to.</param> /// <param name="cc">A comma-delimited array of string representations of email addresses which a carbon copy of the email should be sent to.</param> /// <param name="bcc">A comma-delimited array of string representations of email addresses which a blind carbon copy of the email should be sent to.</param> /// <param name="subject">The subject of the email.</param> /// <param name="message">The body of the email, in HTML.</param> /// <param name="attachments">An array of attachments.</param> /// <param name="priority">The priority of the email.</param> public static void SendHtmlEmail(string from, string sender, string to, string cc, string bcc, string subject, string message, AttachmentCollection attachments, MailPriority priority) { MailMessage mailMessage = new MailMessage(); mailMessage.To.Add(to); mailMessage.CC.Add(cc); mailMessage.Bcc.Add(bcc); mailMessage.Subject = subject; mailMessage.From = new MailAddress(from); mailMessage.Sender = new MailAddress(sender); mailMessage.IsBodyHtml = true; mailMessage.Body = message; mailMessage.Priority = priority; foreach (Attachment each in attachments) { mailMessage.Attachments.Add(each); } SendEmail(mailMessage, from, GoogleAccounts.Account(from).Password); }