Example #1
0
 public POP3Item(MailMessage msg)
 {
     this.From = msg.From;
     this.To = msg.To;
     this.Subject = msg.Subject;
     this.Body = msg.Body;
 }
Example #2
0
        public MailMessage ReadAsMailMessage()
        {
            MailMessage msg = new MailMessage();
            msg.Body = Body;
            msg.Subject = Subject;
            msg.From = From;
            msg.To = To;

            if (IsMultipart)
            {
                msg.Attachments = new List<Pop3Component>();
                IEnumerator enumerator = MultipartEnumerator;
                while (enumerator.MoveNext())
                {
                    Pop3Component multipart = (Pop3Component)enumerator.Current;
                    if (multipart.IsBody)
                        msg.Body = multipart.Data;
                    else
                        msg.Attachments.Add(multipart);
                }
            }

            return msg;
        }