themax90 Posted December 5, 2005 Share Posted December 5, 2005 (edited) This script will allow you to connect to any mail server, smtp server, http server, ETC. I made this to show how you may be able to retreive email information and thanks to LxP it now works. For example you can connect and goto a mail server, type user <username>, pass <password>, and list, and use various string functions to determine how many messages are there. I will soon be making an email client based on this theory. #include <GuiConstants.au3> #include <GuiEdit.au3> #include <Misc.au3> Local $Server = InputBox("Server", "Please input the server you would like to connect to:") Local $Port = InputBox("Server Port", "Please input the port or the server you would like to connect to:") TCPStartup() $MainSocket = TCPConnect(TCPNameToIP($Server), $Port) If $MainSocket = -1 Then Exit MsgBox(0, "Error", "Could Not Connect or Bad Connection") GUICreate("Server Client", 390, 210) $Send = GUICtrlCreateEdit("", 10, 10, 175, 150, $WS_VSCROLL) Local $History = GUICtrlCreateEdit("Mail Server Messages:", 200, 10, 175, 150, BitOR($WS_VSCROLL, $ES_READONLY)) $SButton = GUICtrlCreateButton("Send", 145, 165, 100, 35) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit ElseIf $msg = $SButton Or _IsPressed ("0D") = 1 Then $Text = GUICtrlRead($Send) $TCPSent = TCPSend($MainSocket, $Text & @LF) GUICtrlSetData($Send, "") EndIf $Recv = TCPRecv($MainSocket, 512) If $Recv <> "" Then GUICtrlSetData($History, GUICtrlRead($History) & @CRLF & $Recv) _GUICtrlEditLineScroll ($History, 0, _GUICtrlEditGetLineCount ($History)) EndIf WEnd Func OnAutoItExit() TCPCloseSocket($MainSocket) TCPShutdown() EndFunc;==>OnAutoItExit Hope you like, AutoIt Smith Edited December 6, 2005 by AutoIt Smith Link to comment Share on other sites More sharing options...
LxP Posted December 5, 2005 Share Posted December 5, 2005 Works very nicely -- a perfect interface to use for learning POP-speak. One quick suggestion: Local $History = ... $WS_VSCROLL + $ES_READONLY ... should instead be: Local $History = ... BitOR($WS_VSCROLL, $ES_READONLY) ... since this is the way to do it as per the help file: To combine styles... use BitOr(Style, Style, Style). Link to comment Share on other sites More sharing options...
=sinister= Posted December 5, 2005 Share Posted December 5, 2005 vey impressive, but is there a reason why you have 2 include<guiconstants.au3> and include<guiedit.au3>'s? Link to comment Share on other sites More sharing options...
themax90 Posted December 6, 2005 Author Share Posted December 6, 2005 (edited) Umm sorry error on my part, I copied and pasted must not have selected all. Not only can you use APOP, but any of the well known server lists and ANY Server that users TCP if configured correctly. Edited December 6, 2005 by AutoIt Smith Link to comment Share on other sites More sharing options...
Mosquitos Posted December 6, 2005 Share Posted December 6, 2005 Can i use this script like DameWare Mini Remote Control? Because on my work they use this but all the antispyware tools give an alert when i use that. Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
themax90 Posted December 6, 2005 Author Share Posted December 6, 2005 DameWare Mini Remote Control probably has a registered certificate and is registered in the registry, how ever, there should be no problem. Please post what antispyware tool you use and I will alert Jon so he can contact them and have there lists updated. Link to comment Share on other sites More sharing options...
Mosquitos Posted December 6, 2005 Share Posted December 6, 2005 BitDefender Internet Security 9 Microsoft Antispyware Hitman Pro, hitman pro uses ad aware, spysweeper, spybot search & destroy,etc Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
themax90 Posted December 6, 2005 Author Share Posted December 6, 2005 Can you post all EXACT details of how it thinks its what. Link to comment Share on other sites More sharing options...
Mosquitos Posted December 6, 2005 Share Posted December 6, 2005 Can you post all EXACT details of how it thinks its what.What do you mean? Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
themax90 Posted December 7, 2005 Author Share Posted December 7, 2005 Tell us how to recreate the error. Link to comment Share on other sites More sharing options...
Colin Posted April 3, 2008 Share Posted April 3, 2008 Hi, I'm new to TCP functionality and I'm getting a lot of help from all your assorted scripts. I know this post is old but it is linked to in a number of other of your topics regarding TCP and it is used as an example of a client that connects to the example of a server you have. I'm just messing around with it at this point trying to get it to connect. I know this is my first post and all, but I'm actually posting to point out a possible error. When I run this I connect to the server and just as a test I send /hello to see if I get a response. Instead I get an error on line 26, Unknown function name. _GUICtrlEditLineScroll ($History, 0, _GUICtrlEditGetLineCount ($History)) I looked up both of those functions and it looks like you have a small typo on both. The code should be: _GUICtrlEdit_LineScroll ($History, 0, _GUICtrlEdit_GetLineCount ($History)) When I modify the code to match that, it works. Now, I don't want to presume that you've made a mistake or anything, so if this is just something on my end (possibly an autoit version issue considering this post is a few years old and I'm using the latest version) then disregard this message. Although, if anyone else is getting this same error (which would be surprising since it seems like no one has mentioned it yet) then try modifying the code as I did. Thanks. Link to comment Share on other sites More sharing options...
myspacee Posted April 4, 2008 Share Posted April 4, 2008 Nice script,miss when i search info about Autoit mail client and IMAPAny step in this way ?is so difficult to read 'mail' if you are inside ? maybe only few information ? (sender, object)TomZ suggest some way to do this but is too advancedfor my Autoit knowledgeMy dream is to give order to a 'server' by mail, an Autoit script can monitor incoming mail and run different taskAny idea ?Thank you m. Link to comment Share on other sites More sharing options...
TomZ Posted April 5, 2008 Share Posted April 5, 2008 There is no simple way to receive sender and subject of an email message stored on a POP3-server using AutoIt, without using 3rd party plugins or software. 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