login about faq

Is it possible to download attachments using POP3 or do I have to use IMAP?

It seems like there are POP3 examples, but when I try to run them, it always tells me that I have zero attachments and/or will not display the attachment even though I know there are several.

Some sample C# code:

            int i;
            Chilkat.Email email = null;
            for (i = 0; i <= bundle.MessageCount - 1; i++)
            {
                email = bundle.GetEmail(i);

                Console.WriteLine("From: " + email.From);
                Console.WriteLine("Subject: " + email.Subject);
                Console.WriteLine("Attachments: " + email.GetAttachmentFilename(i));
                Console.WriteLine("NumAttachments: " + email.NumAttachments.ToString());
                Console.WriteLine(" ------- ");

                if (email.Subject == "test subject") )
                {
                    int numAtt = email.NumAttachments;
                    success = email.SaveAllAttachments("BillingAttachments");

                    if (success != true)
                    {
                        Console.WriteLine(email.LastErrorText);
                        return;
                    }
                }
            }

asked Jan 12 '15 at 10:40

pbockhorst's gravatar image

pbockhorst
1


Maybe you are downloading headers-only? With POP3, if you are downloading the full email, you'll get all the attachments as well..

link

answered Jan 12 '15 at 20:14

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×60
×18

Asked: Jan 12 '15 at 10:40

Seen: 841 times

Last updated: Jan 12 '15 at 20:14

powered by OSQA