Leykis101 Posted December 13, 2006 Share Posted December 13, 2006 I am looking for a way to make my program check my email a set amount of times, every x amount of seconds. I think I have the code that should work, but I cant get it to work for some reason. It will login, check then logout once. But the second time it initiates a login, the pop3 server never responds. Can someone offer a helping hand please? CODEFor $x = 1 to 2 _pop3Connect($MyPopServer, $MyLogin, $MyPasswd) ConsoleWrite(@AutoItVersion & @CRLF) If @error Then ConsoleWrite(@AutoItVersion & @CRLF) MsgBox(0, "Error", "Unable to connect to " & $MyPopServer & @CR & @error) ConsoleWrite(@AutoItVersion & @CRLF) Exit ConsoleWrite(@AutoItVersion & @CRLF) Else ConsoleWrite("Connected to server pop3 " & $MyPopServer & @CR) EndIf $stat = "" Local $stat = _Pop3Stat() ConsoleWrite ( @error ) If $stat[1] <> 0 Then _ArrayDisplay($stat, "Result of STAT COMMAND") ExitLoop Else ConsoleWrite(_Pop3Quit() & @CR) Sleep(5000) EndIf Next I have attached the UDF file that contains the pop3 commands. Thanks in advance!_pop3.au3 Link to comment Share on other sites More sharing options...
Zedna Posted January 6, 2007 Share Posted January 6, 2007 Nice POP3 native functions!! I looked at your code and didn't find any visible AutoIt errors. So no help from me but thanks for sharing this interesting stuff ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
sylvanie Posted January 6, 2007 Share Posted January 6, 2007 hello, You've just forgotten to initialize $pop3_IsAuth and $pop3_IsConnected to "0" in the function _Pop3Quit() Func _Pop3Quit() If $pop3_IsAuth = 1 Then $pop3_IsAuth = 0; <-------------------- here $ret = TCPSend ($pop3_socket, "QUIT" & @CRLF) If @error Then SetError($pop3_error_quit_refused) Return -1 EndIf $ret = _WaitTcpResponse() If @error Then SetError($pop3_error_no_TCP_response) Return -1 EndIf $pop3_IsConnected = 0; <-------------------- here Return $ret Else SetError($pop3_error_no_auth) Return -1 EndIf EndFunc ;==>_Pop3Quit oÝ÷ ØjºÞ~éwÜZ½ëzv¬h¥j·«®â«¢+Ø)Õ¹}Á½Àͥͽ¹¹Ð ¤(%%ÀÌØíÁ½ÀÍ}%Í ½¹¹Ñ±ÐìÐìÀQ¡¸($%Q A ±½ÍM½Ð ÀÌØíÁ½ÀÍ}ͽФ($%Q AM¡Õѽݸ ¤($$ÀÌØíÁ½ÀÍ}%Í ½¹¹ÑôÀì±Ðì´´´´´´´´´´´´´´´´´´´´¡É($%IÑÕɸÀ(%±Í($%MÑÉÉ½È ÀÌØíÁ½ÀÍ}ÉɽÉ}¹½Ñ}½¹¹Ñ¤($%IÑÕɸ´Ä(%¹%)¹Õ¹ìôôÐí}Á½Àͥͽ¹¹Ð( bye Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now