Receiving e-mail using POP3

This is a library for accessing a pop3 email box.

With this library you will be able to:

  • Access any pop3 email box (if your network allows it)
  • See what is in that mailbox (number of emails and sizes, etc.).
  • Read the emails and delete them if you want to.
  • Read all properties of an email.
  • Handele Attachments

Click here to download the complete source code, the compiled DLL and the demo.

Here is some sample code:

18 thoughts on “Receiving e-mail using POP3”

  1. Admin, i just want to ask.

    Why this code doesn’t work with gmail?
    i set the pop server on: pop.gmail.com
    and port at: 995
    as published in gmail web.

    the result is error and total message is zero.

    Many thanks for you, if you mind to help 🙂

    1. Port 995 is not the default port for pop. Did you also specify the port in the pop3 component as the sample shows? Are you able to connect to that email acount using an other mail client? What doe you see in the status event (see sample)

  2. We’re using the pop3 dll for a couple of years without any problem.
    We have change our server now to “Windows Server 2008 R2” and Office (or better Access) 2010 (32 bit).
    After this change our application crashes, when it used Pop3.Connect.

    Thanks for any help !

    Regards
    Jens

  3. Hi admin I have one Problem How can i see Picture of POP Mail wheil i can see only text but not Picture, I want see it Complet when i Reciept mail from any website Thnx

      1. and Mr Edwin:
        Why In Boyd of Mail is so

        for example
        I see very very ‘=09’ for this Mail for another auch, but if i it Clean of =09 mail is normal Can You Explique pls.

        !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

        =09
        =09=09
        =09=09Hallo S=FCleyman, H=F6rzu Wissen f=FCr nur 9 Euro testen und LG Handy geschenkt
        =09
        =09
        =09=09


        =09=09
        =09=09=09
        =09=09=09
        =09=09=09=09
        =09=09=09=09
        =09=09=09=09
        =09=09=09
        =09=09=09
        =09=09
        =09=09<!– BEGIN

  4. I’ve inserted code from POP3Demo project into my VB6 project.
    DLL is linked, POP3 object successfully creates and can connect to mailbox.
    I can use MessageCount and TotalMessageSize properties it returns valid answers.
    But I can’t access any particular message property.
    When I try to call AttachmentCount MessageID or any other property with message ordinal number (1,2,3 etc) as parameter I got error from server – “AttachmentCount(1) failed! The message ID does not exist.”

    Please help. Exactly the same code in demo works perfectly!

    1. Hi, Working with attachments is easy.
      You can find the number of attachments with: POP3.AttachmentCount(id)
      The filename of the first attachment is: POP3.AttachmentName(id, 1)
      The content type of the attachment is: POP3.AttachmentContentType(id, 1)
      The encoding used is: POP3.AttachmentEncoding(id, 1)
      The attachment itself is: POP3.Attachment(id, 1)
      And the attachment can be saved with: SaveFile App.Path & “\” & POP3.AttachmentName(id,1) ,POP3.Attachment(id,1)

  5. Hello,
    I am trying to use the Dll in a project using MS Access.
    Every time i get to the connect the Access app crashed.
    I have tried on 2 separate machines.
    PC’s are Windows 7 32bit, Office 2010 version 14.0.6112
    I installed the VB6 run times.
    Any thoughts?
    Best regards
    James

    1. I do not have experience with using this DLL with MS Access. Did you create event handlers for all the events (such as Status)? Did you also register the clientServer.dll? Could you send me a small access database with the sample code of how you use it? Please email it to edwin at evict dot nl.
      Regards, Edwin

  6. Hello Edwin,

    thanks for the dll an you support.

    I have one problem: an attached excel-file (xlsx) gives an empty file-name.

    e.g.:POP3.AttachmentName(intloop, Counter)

    Can you help me?

    Regards

    Patrick

    1. Could it be that the .ContentType of the message is not ‘multipart’? You could find out more by looking at the .RawEmailText(id). You should see the text ‘name=’ after the message seperator. If you want to know how the name is retrieved, then have a look at the property AttachmentName in the class POP3.cls. I do not have VB6 installed anymore, so I can not debug or bug fix the code.

Leave a Reply

Playground of Edwin Vermeer