Beispiel #1
0
        /// <summary>
        /// Create a new e-mail envelop based on the given
        /// e-mail builder data.
        /// </summary>
        /// <param name="MailBuilder">An e-mail builder.</param>
        public EMailEnvelop(AbstractEMailBuilder MailBuilder)
        {
            MailBuilder.EncodeBodyparts();

            // ToDo: Deep cloning!
            this._MailFrom = new EMailAddressList(MailBuilder.From);
            this._RcptTo   = new EMailAddressList(MailBuilder.To);
            this._Mail     = new EMail(MailBuilder);
        }
Beispiel #2
0
        /// <summary>
        /// Create a new e-mail based on the given e-mail builder.
        /// </summary>
        /// <param name="MailBuilder">An e-mail builder.</param>
        public EMail(AbstractEMailBuilder MailBuilder)

            : this(MailBuilder.
                   EncodeBodyparts().
                   // Copy only everything which is not related to the e-mail body!
                   MailHeaders.Where(header => !header.Key.ToLower().StartsWith("content")).
                   Concat(MailBuilder.Body.MailHeaders))

        {
            //ToDo: Do a real deep-copy here!
            Body = MailBuilder.Body;

            //ToDo: Work-aroung for PGP/GPG!
            this.From = MailBuilder.From;
            this.To   = MailBuilder.To;
            this.Cc   = MailBuilder.Cc;
        }