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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
Public WithEvents POP3 As EVICT_POP3.POP3 Private Sub cmdLogin_Click() Dim intloop As Integer, id As Integer Set POP3 = New EVICT_POP3.POP3 POP3.POPHost = "pop3.myprovider.com" POP3.POPPort = 110 POP3.UserName = "MyUserName" POP3.Password = "MyPassWord" POP3.Connect MsgBox POP3.MessageCount & " berichten, " & _ POP3.TotalMessageSize & " bytes." For intloop = 1 To POP3.MessageCount Debug.Print intloop & ", " & _ POP3.MessageSize(intloop) & ", " & _ POP3.UniqueMessageID(intloop) & ", " & _ POP3.Subject(intloop) Next Debug.Print "+ From : " & POP3.From(id) & vbCrLf & _ "+ From : " & POP3.From(id) & vbCrLf & _ "+ To : " & POP3.Recipient(id) & vbCrLf & _ "+ CC : " & POP3.CC(id) & vbCrLf & _ "+ Subject : " & POP3.Subject(id) & vbCrLf & _ "+ Email body :" & POP3.Body(id) & vbCrLf End Sub Private Sub POP3_Status(Status As String) Debug.Print Status End Sub |
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 🙂
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)
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
Are you just using the pop3 dll? It could be that the VB6 runtime files needs to be installed on the server. You can find those here: http://support.microsoft.com/kb/290887
If you log everything that gets to the POP3_Status event, then what do you see?
Jens – did you ever fix this?
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
Pictures are attachments in the email. If there are pictures used embeded in an html email, then they will have a cid url like
and there wil be an attachment named filename.gif
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
I think this is an encoding issue. Do you use UTF8 or UTF16?
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!
this dll dosen’t support SSL ?
gmail use ssl
Sorry, It does not support SSL.
Hello, how do I copy the file attached in this email to a folder on your computer?
Thank you!
Jose Luiz, Brazil
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)
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
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
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
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.