myspacee Posted March 31, 2008 Share Posted March 31, 2008 Hello to all, mad idea but can work: Want to run remote script on my 'server'; but my server must listening with email client. Is possible to build a simple email client with Autoit ? Need only to receive object list, with keywords can be simple run other things. Can anyone help me? Thank you M. Link to comment Share on other sites More sharing options...
rudi Posted March 31, 2008 Share Posted March 31, 2008 Hi.Hello to all,mad idea but can work:Want to run remote script on my 'server'; but my server must listening with email client.Is possible to build a simple email client with Autoit ?Look at RFC 821: http://www.ietf.org/rfc/rfc0821.txtLook at autoit's help file for TCPListen.Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
TomZ Posted March 31, 2008 Share Posted March 31, 2008 (edited) Dear Rudi, you're refferring to the wrong RFC and the wrong function. Sorry. The right RFC is http://www.ietf.org/rfc/rfc1939.txt (SMTP = send email, POP3 = receive) I've done alot of POP3 work, so I decided to write an example for you (not tested by the way, but should work)Example of POP3 usage in AutoIt:expandcollapse popupTCPStartUp() $user = "your username on the pop3 server goes here" $pass = "your password goes here" ;connect $sock = TCPConnect(TCPNameToIP("mail.yourdomain.com"), 110) If $sock = -1 Then Exit MsgBox(48, "Error", "Couldn't connect to POP3 server!") ;reveice inital response Do $data = TCPRecv($sock, 1024) Untill $data <> "" ;Verify data for +OK or -ERR - todo ;send username TCPSend($sock, "USER " & $user & @CRLF) Do $data = TCPRecv($sock, 1024) Untill $data <> "" ;Verify data for +OK or -ERR - todo ;send password TCPSend($sock, "PASS " & $pass & @CRLF) Do $data = TCPRecv($sock, 1024) Untill $data <> "" ;Verify data for +OK or -ERR - todo ;request number of messages TCPSend($sock, "STAT" & @CRLF) Do $data = TCPRecv($sock, 1024) Untill $data <> "" ;Verify data for +OK or -ERR - todo ;parse response $data = StringSplit($data, " ") If IsArray($data) and $data[0] > 1 and StringIsInt($data[2]) Then $numbermessages = $data[2] MsgBox(32, "Mail Example", "There are " & $numbermessages & " messages in your POP3 box!") Else MsgBox(48, "Mail Example", "Unexpected response from mailserver!") EndIf TCPSend($sock, "QUIT" & @CRLF) TCPCloseSocket($sock) TCPShutDown() Exit Edited March 31, 2008 by TomZ Link to comment Share on other sites More sharing options...
myspacee Posted March 31, 2008 Author Share Posted March 31, 2008 Thank you for reply,but i imagine some step was made in past with Autoit and mail client (here)Find also a similar product here but i think that Autoit is perfect for these taskAny other suggestion?Anyone interested ? (possible?)Think application...M. Link to comment Share on other sites More sharing options...
TomZ Posted March 31, 2008 Share Posted March 31, 2008 This is certainly possible in AutoIt. Why doesn't my example meet your needs (or did you miss my post?)? Link to comment Share on other sites More sharing options...
myspacee Posted March 31, 2008 Author Share Posted March 31, 2008 TomZ,sorry i miss your post (write reply in same time)Your script return number of mail, is good start, but my goal is buld mini-client to readonly few informations (sender, object).My idea is to send an email to my home pc and do some task(mad idea here)thank you for script and info,thank to rudi too, you reply is funny m. Link to comment Share on other sites More sharing options...
TomZ Posted March 31, 2008 Share Posted March 31, 2008 I'd like to give you a hint on adapting my script to actually receive email's. I believe you should use TCPSend($sock, "RETR message_number" & @CRLF); This will then start outputting the contents of the message with the number you sent to the server, ending with a dot. Like so: Message header Message header .... Message body Message body .... (Attachments) . <--- ending dot Message numbers range from 1 to the number of messages the script gives you. Other usefull commands may be LIST and DELE. 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