Sicos1977 / MsgKit

A .NET library to make MSG files without the need for Outlook
199 stars 56 forks source link

Draft attribute within email constructor #63

Closed tjsingh28 closed 4 years ago

tjsingh28 commented 4 years ago

It would be great if you allow another constructor that can set draft = true. Currently, I had to download the entire project and rebuild with a new draft attribute. Thanks!

Sicos1977 commented 4 years ago

There is a constructor that does that

        /// <summary>
        ///     Creates this object and sets all the needed properties
        /// </summary>
        /// <param name="sender">The <see cref="Sender"/> of the E-mail</param>
        /// <param name="subject">The subject of the E-mail</param>
        /// <param name="draft">Set to <c>true</c> to save the E-mail as a draft message</param>
        /// <param name="readReceipt">Set to <c>true</c> to request a read receipt for the E-mail</param>
        public Email(Sender sender, 
                     string subject,
                     bool draft = false,
                     bool readReceipt = false)
        {
            Sender = sender;
            Subject = subject;
            Importance = MessageImportance.IMPORTANCE_NORMAL;
            IconIndex = MessageIconIndex.NewMail;
            Draft = draft;
            ReadRecipient = readReceipt;
        }

You can just set draf to true and thats it.