This project is read-only.

can not see attachments

May 10, 2012 at 2:44 PM

The email has a attachment on it, but when I run this code it tells me there aren't any attachements. (I am connecting to a gmail.)

ActiveUp.Net.Mail.Mailbox inbox = _Iclient.ExamineMailbox(MailBox);
                int[] ids = inbox.Search("UNSEEN");
                string filedir;
                foreach (int Nmail in ids)
                {
                    Message msg = inbox.Fetch.MessageObject(Nmail);
                    List<string> filePaths = new List<string>();
                    if (msg.Subject.Contains(LikeSubject) && msg.From.Email.Equals(FromAddress))
                    {
                        var en = msg.Attachments.GetEnumerator();
                        while (en.MoveNext())
                        {
                            MimePart ob = en.Current as MimePart;
                            filedir = UniqueFilePath(ob.Filename);
                            ob.StoreToFile(filedir);
                            filePaths.Add(filedir);
                        }
                        nmail.Add(new UnreadMail(FromAddress, msg.Subject, msg.BodyText.Text, filePaths));
                    }
                }
            }

Jan 30, 2013 at 5:51 AM

I am having this same issue.  The emails I'm accessing in my inbox all have attachments, and the Message object says there are none when I try to retrieve them via Imap through this library.  Please help??

Jan 30, 2013 at 1:35 PM

We had the problem too. But normally it is very simple to solve.

When the mail is not well formatted, attachments are stored in msg.UnknownDispositionMimeParts or in msg.EmbeddedObjects

There are three collections where attachments are stored, it depends on "Content-Disposition" in the eml file.