protected override void ProcessRecord() { AddressObject sender = null; if (!string.IsNullOrWhiteSpace(this.SenderEmail)) { sender = new AddressObject(this.SenderEmail, this.SenderDisplayName); } var email = new EmailObject(sender, this.Subject, this.Draft) { BodyText = this.BodyText, BodyHtml = this.BodyHtml, Importance = this.Importance //IconIndex = MessageIconIndex.UnsentMail; }; WriteObject(email); base.ProcessRecord(); }
public EmailObject(AddressObject sender, string subject, bool draft) { this.Sender = sender; this.Subject = subject; this.Draft = draft; }