|
-
May 27th, 2016, 07:59 AM
#35
Re: VB6-pop3 email
The ws_DataArrival subroutine is an event handler. Its bytesTotal argument is passed to your event handler subroutine by the Winsock control. However most serious code ignores it since by the time your handler gets run its value might be out of date anyway, and relying on it could mean losing or corrupting data. It is pretty obsolete but retained for compatibility with old programs.
If you don't know this you need to work on your VB skills. It is all pretty basic stuff.
Reliance on bytesTotal here (in the code above) is pathological. The myData variable could well have more characters in it than this, and later bytesTotal is used instead of the far more reliable Len(myData). This is a bad indicator of the quality of all of this code, which indeed has a ton of "well it might work if you get lucky" things in it.
All in all, this is sort of flaky more-or-less-working code for the way email worked in the late 1990s. You'd be far better off to pay for a licensed 3rd party POP3 library, which is likely to support SSL/TLS and modern authentication too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|