/// <summary>
        /// Create a new attachment, add it to the list.
        /// </summary>
        /// <param name="InPart"></param>
        /// <returns></returns>
        public MimeAttachment AddNewAttachment(MimeMessagePart InPart)
        {
            MimeAttachment attach = new MimeAttachment(InPart);

            base.Add(attach);
            return(attach);
        }
Esempio n. 2
0
        // -------------------------- GetTopPart -------------------------
        // find and return the MimePartCode.Top part in the list of parts.
        // ( this is the part that contains the message header info like subject, from, ...
        public MimeMessagePart GetTopPart( )
        {
            MimeMessagePart returnPart = null;

            foreach (MimeMessagePart part in this)
            {
                if (part.PartCode == MimePartCode.Top)
                {
                    returnPart = part;
                    break;
                }
            }
            return(returnPart);
        }
        /// <summary>
        /// Build list of attachments in the mime message.
        /// </summary>
        /// <param name="InPartList"></param>
        /// <returns></returns>
        public MimeAttachmentList BuildList(MimeMessagePartList InPartList)
        {
            // clear the list
            Clear( );

            AcEnumerator it = InPartList.BeginParts( );

            for (it = InPartList.FirstPart( ); it.Current != null; it.MoveNext( ))
            {
                MimeMessagePart part = (MimeMessagePart)it.Current;
                PartProperty.ContentDisposition disp = part.Properties.ContentDisposition;
                if ((disp != null) && (disp.Disposition == "attachment"))
                {
                    AddNewAttachment(part);
                }
            }
            return(this);
        }
Esempio n. 4
0
        // ----------------------- AddNewPart -------------------------------
        public MimeMessagePart AddNewPart(MimePartCode InPartCode)
        {
            MimeMessagePart part = null;

            if (InPartCode == MimePartCode.Top)
            {
                part = new MimeTopPart( );
            }
            else
            {
                part = new MimeMessagePart( );
            }

            part.PartCode = InPartCode;
            base.Add(part);

            return(part);
        }
Esempio n. 5
0
        public MimeMessagePart AddNewPart(
            string InStream, MimeMessagePart.PartInProgress InPip)
        {
            MimeMessagePart part = null;

            if (InPip.PartCode == MimePartCode.Top)
            {
                part = new MimeTopPart( );
            }
            else
            {
                part = new MimeMessagePart( );
            }

            part.PartCode = InPip.PartCode;
            base.Add(part);

            // store the property lines of the part.
            if (InPip.PropBx != -1)
            {
                part.LoadPropertyLines(InStream, InPip.PropBx, InPip.PropLineCx);
            }

            // store the message lines of the part.
            if (InPip.MessageBx != -1)
            {
                part.LoadMessageLines(InStream, InPip.MessageBx, InPip.MessageLineCx);
            }

            // the message lines are quoted-printable encoded. decode here.
            if (AcCommon.StringValue(part.Properties.ContentTransferEncoding)
                == "quoted-printable")
            {
                part.DecodeMessageLines( );
            }

            return(part);
        }
 public MimeAttachment(MimeMessagePart InPart)
 {
     mPart     = InPart;
     mFileName = InPart.Properties.ContentDisposition.FileName;
 }
Esempio n. 7
0
 // ----------------------- AddPart -------------------------------
 public MimeMessagePartList AddPart(MimeMessagePart InPart)
 {
     base.Add(InPart);
     return(this);
 }