'Checks your POP3 email account and returns how many emails you have and the total size of the emails in bytes
'the POP3 RFC is at http://www.faqs.org/rfcs/rfc1939.html
------------------
'the POP3 RFC is at http://www.faqs.org/rfcs/rfc1939.html
Code:
#COMPILE EXE 'PB/CC $SERVER = "127.0.0.1" 'your pop3 server $xUSER = "wayne" 'your username $xPASS = "password" 'your password FUNCTION PBMAIN() AS LONG ON ERROR RESUME NEXT DIM lPos AS LONG DIM sBytes AS STRING CRLF$ = CHR$(13) & CHR$(10) LOCAL hSocket AS LONG TCP OPEN PORT 110 AT $SERVER AS hSocket TIMEOUT 10 IF ERR THEN PRINT "Couldn't connect!"; ERR EXIT FUNCTION END IF TCP RECV hSocket, 1024, Buffer$ STDOUT Buffer$; TCP SEND hSocket, "USER " & $xUSER & CRLF$ TCP RECV hSocket, 1024, Buffer$ STDOUT Buffer$; TCP SEND hSocket, "PASS " & $xPASS & CRLF$ TCP RECV hSocket, 1024, Buffer$ STDOUT Buffer$; TCP SEND hSocket, "STAT" & CRLF$ TCP RECV hSocket, 1024, Buffer$ lPos = INSTR(5,Buffer$," ") sBytes = RIGHT$(Buffer$, LEN(Buffer$) - lPos) sBytes = LEFT$(sBytes, LEN(sBytes) - 2) STDOUT "You have " & MID$(Buffer$, 5, lPos - 5) & " messages (" & sBytes & " bytes)" CLOSE hSocket END FUNCTION
------------------
Comment