/// <summary> /// /// </summary> /// <param name="encoding"></param> /// <returns></returns> public String GetRawText(Encoding encoding) { MemoryStream mm = new MemoryStream(); var sw = new MimeWriter(mm); sw.Write(this); return(encoding.GetString(mm.ToArray())); }
/// <summary> /// /// </summary> /// <param name="from"></param> /// <param name="message"></param> public SendMailCommand(String from, SmtpMessage message) { this.From = new MailAddress(from); List <MailAddress> l = new List <MailAddress>(); l.AddRange(message.To); l.AddRange(message.Cc); l.AddRange(message.Bcc); this.RcptTo.AddRange(l); MemoryStream mm = new MemoryStream(); var sw = new MimeWriter(mm); sw.Write(message); this.Data = mm.ToArray(); }
/// <summary> /// /// </summary> /// <param name="encoding"></param> /// <returns></returns> public String GetRawText(Encoding encoding) { MemoryStream mm = new MemoryStream(); var sw = new MimeWriter(mm); sw.Write(this); return encoding.GetString(mm.ToArray()); }