Home All Groups Group Topic Archive Search About
Author
5 Sep 2010 8:09 PM
fniles
Can I use Winsock to read POP 3 mails ?
When I do this, Winsock1.State stays at 6 (connecting), and it is never 7
(connected).
    Winsock1.Connect "mail.myservermail.com", 110
    Do While Winsock1.State <> 7

    Loop
    Winsock1.SendData "USER myu***@company.com"
    Winsock1.SendData "PASS mypwd"

If I go to a browser and enter "mail.myservermail.com", it goes to that
website right away and I can enter the user name and password.
Why my winsock state stays at 6 (connecting) and never 7 (connected) ?
Is the port number for POP 3 emails always at 110 ?
Is winsock the correct way to read POP 3 emails ?

Thank you

Author
6 Sep 2010 12:08 AM
Tony Toews
On Sun, 5 Sep 2010 15:09:32 -0500, "fniles" <fni***@pfmail.com> wrote:

>Can I use Winsock to read POP 3 mails ?

Yes.

>If I go to a browser and enter "mail.myservermail.com", it goes to that
>website right away and I can enter the user name and password.

Yes but <smile> that's on port 80.   Your browser is connecting on
port 80 and "massaging" everything you see via the http protocol.  A
better means of testing would be to go to the command prompt and use
telnet with the mail server name and a port number. 

Pop servers sometimes might be pop.example.com or even
pop3.example.com.

>Why my winsock state stays at 6 (connecting) and never 7 (connected) ?
>Is the port number for POP 3 emails always at 110 ?
>Is winsock the correct way to read POP 3 emails ?

Yes, but this part I don't know.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
  updated see http://www.autofeupdater.com/
Author
6 Sep 2010 2:27 AM
fniles
Thank you.

When I go to command prompt and telnet mail.myservermail.com 110, I got a
window that says +OK <{some number}.{some numbers}@mail>

Without checking for Winsock1.state <> 7, if I call Winsock1.SendData "USER
myu***@company.com" directly, I got the error "Runtime error 40006. Wrong
protocol or connection state for the requested transaction or request".


Show quoteHide quote
"Tony Toews" <tto***@telusplanet.net> wrote in message
news:n2c8861fs7njuujvpfj8soidbm7p570p0d@4ax.com...
> On Sun, 5 Sep 2010 15:09:32 -0500, "fniles" <fni***@pfmail.com> wrote:
>
>>Can I use Winsock to read POP 3 mails ?
>
> Yes.
>
>>If I go to a browser and enter "mail.myservermail.com", it goes to that
>>website right away and I can enter the user name and password.
>
> Yes but <smile> that's on port 80.   Your browser is connecting on
> port 80 and "massaging" everything you see via the http protocol.  A
> better means of testing would be to go to the command prompt and use
> telnet with the mail server name and a port number.
>
> Pop servers sometimes might be pop.example.com or even
> pop3.example.com.
>
>>Why my winsock state stays at 6 (connecting) and never 7 (connected) ?
>>Is the port number for POP 3 emails always at 110 ?
>>Is winsock the correct way to read POP 3 emails ?
>
> Yes, but this part I don't know.
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
> For a convenient utility to keep your users FEs and other files
>  updated see http://www.autofeupdater.com/
Author
6 Sep 2010 3:58 AM
Tony Toews
On Sun, 5 Sep 2010 21:27:44 -0500, "fniles" <fni***@pfmail.com> wrote:

>When I go to command prompt and telnet mail.myservermail.com 110, I got a
>window that says +OK <{some number}.{some numbers}@mail>

Yup, that's about right.  If you were patient enough you could
actually read an email by typing in the right commands.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
  updated see http://www.autofeupdater.com/
Author
6 Sep 2010 1:31 AM
Nobody
Download Socket Wrench Freeware(including commercial use), and check
"CheckMail" sample, which shows how to check for email.

http://www.catalyst.com/products/socketwrench/freeware/index.html
Author
6 Sep 2010 1:54 AM
Mayayana
You can do it with the winsock control. You
can also use winsock without the control. The control
is just a wrapper around the API.

You can find various sample code here:

http://planetsourcecode.com/vb/scripts/BrowseCategoryOrSearchResults.asp?lngWId=1&txtCriteria=pop3

There used to be a download called mailcheck.zip
from vbip.com for doing POP3 with no dependencies.
Vbip is gone now. I don't know if the download is still
out there.

Another option might be this:
http://www.ericphelps.com/pop3/index.htm

Download the "power user version" for source code.
Sorry I'm not being more definitive. I know there's
lots of code out there, and I know you don't need to
add dependencies in order to do what you want, but
I've never had occasion to need POP3 code myself,
so I can't tell you which is best.

Show quoteHide quote
| Can I use Winsock to read POP 3 mails ?
| When I do this, Winsock1.State stays at 6 (connecting), and it is never 7
| (connected).
|    Winsock1.Connect "mail.myservermail.com", 110
|    Do While Winsock1.State <> 7
|
|    Loop
|    Winsock1.SendData "USER myu***@company.com"
|    Winsock1.SendData "PASS mypwd"
|
| If I go to a browser and enter "mail.myservermail.com", it goes to that
| website right away and I can enter the user name and password.
| Why my winsock state stays at 6 (connecting) and never 7 (connected) ?
| Is the port number for POP 3 emails always at 110 ?
| Is winsock the correct way to read POP 3 emails ?
|
| Thank you
|
|