Jump to content

Pop3 email UDFs


theguy0000
 Share

Recommended Posts

Well, I searched around, then I asked around, but nobody seemed to have ever made pop3 functions for AutoIt. And ta-da, pop3.au3

It's just a starter, of course. Right now all it can do is connect, log in, check number of messages, size of mailbox, and retrieve messages (which I'm not sure is completely perfect). I still need to make it able to delete messages. Also, I have no idea how to make it support connections that require SSL (like gmail). If anyone knows that, I'd be glad to hear it...

Note: You must TcpStartup () bvefore using any pop3 functions and also TcpShutdown at the end of the script.

Anyway, here is a list of the functions:

;===============================================================================
;
; Description:      Connects and logs in to the pop3 server
; Parameter(s):     $sServer  - IP address of the server to connect to
;                   $iPort    - port to connect on - usually 110
;                   $sUser    - Username to use to log in
;                   $sPass    - Password to use to log in
; Requirement(s):   TcpStartup ()
; Return Value(s):  On Success - Difference between the 2 dates
;                   On Failure - False  and Set @Error to:
;                                   1 - Timed out while waiting for server to respond
;                                   2 - Server gave error response
;                                   3 - Could not connect to server
; Author(s):        Matt Roth (theguy0000) <theguy0000 at gmail dot com>
;
;===============================================================================



;===============================================================================
;
; Description:      Counts the number of messages in the mailbox
; Parameter(s):     $sock  - Socket previously returned by _pop3start ()
; Requirement(s):   None.
; Return Value(s):  On Success - Number of messages in the mailbox
;                   On Failure - False  and Set @Error to:
;                                   1 - Timed out while waiting for server to respond
;                                   2 - Server gave invalid response
; Author(s):        Matt Roth (theguy0000) <theguy0000 at gmail dot com>
;
;===============================================================================



;===============================================================================
;
; Description:      Finds the total size of a mailbox.
; Parameter(s):     $sock  - Socket previously returned by _pop3start ()
; Requirement(s):   None.
; Return Value(s):  On Success - Size of the mailbox in octets (bytes).
;                                   1 - Timed out while waiting for server to respond
;                                   2 - Server gave invalid response
; Author(s):        Matt Roth (theguy0000) <theguy0000 at gmail dot com>
;
;===============================================================================



;===============================================================================
;
; Description:      Retrieves a message from the mailbox.
; Parameter(s):     $sock  - Socket previously returned by _pop3start ()
;                   $iNum  - the number of the message to retrieve.
; Requirement(s):   None.
; Return Value(s):  On Success - An Array containing info about the message:
;                                   [0] = Sender
;                                   [1] = Subject
;                                   [2] = the message itself
;                   On Failure - False  and Set @Error to:
;                                   1 - Timed out while waiting for server to respond
;                                   2 - Server gave error response
;                                   3 - Couldn't find some info in the message (eg boundary, sender, subject)
; Author(s):        Matt Roth (theguy0000) <theguy0000 at gmail dot com>
;
;===============================================================================

more to come

download here: pop3.au3

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

  • Moderators

:P Now I've seen it all <_<

An example thread, no exe only, no source and exe, no source... :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

i probably should have put this in a more obvious place, but the download is in the first sentence of the post...

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

  • Moderators

i probably should have put this in a more obvious place, but the download is in the first sentence of the post...

Definately not your fault then, I blame it on the 12 pack I had before I read the post, and the 6 pack I had after words trying to decipher what you just said :) , but alas, I understand and can take a look <_<

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 2 months later...

Sorry I haven't seen your call !

All pop3 funcs are here :

http://www.autoitscript.com/forum/index.php?showtopic=22838

It's old, but still works.

Have fun :D

Apzo.

i'm trying to put this to work for ages..but still, i can't :\

not the ones from this post neither the ones from the post u referred... i'm trying to create a function that reads the first line of the first email and writes it to a .txt file in my local hard drive. :\ any ideas? It's the only script that I need to complete my first BIG project... thanks in advance

Edited by Lord Freshy
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...