Receiving emails with attachments

Discussion in 'Python' started by tomer.ha@gmail.com, Apr 8, 2006.

  1. Guest

    Hi there,

    I'm new to Python, but know other scripting and programming languages.
    I
    want to develop a script which will receive emails with attachments
    from my POP3 account, perform certain actions on it and email it back
    to someone else.

    However, I'm not familiar with any Python library which does it. Could
    you a guide me to a relevant library which can handle emails?

    I haven't decided yet what scripting language I will use, so a nice
    module for Python will probably make me choose it over Perl. :)

    Thanks in advance. :)
     
    , Apr 8, 2006
    #1
    1. Advertising

  2. wrote:

    > Hi there,
    >
    > I'm new to Python, but know other scripting and programming languages.
    > I
    > want to develop a script which will receive emails with attachments
    > from my POP3 account, perform certain actions on it and email it back
    > to someone else.
    >
    > However, I'm not familiar with any Python library which does it. Could
    > you a guide me to a relevant library which can handle emails?
    >
    > I haven't decided yet what scripting language I will use, so a nice
    > module for Python will probably make me choose it over Perl. :)
    >
    > Thanks in advance. :)


    poplib module:

    http://docs.python.org/lib/pop3-example.html

    some example code that I wrote when I was starting Python:

    http://gflanagan.net/site/python/pagliacci/PopClient.html

    ( YMMV with this - it works for me but the emails I handle with it are
    mostly from a single company and attachments are only ever MS Word or
    MS Excel )

    I don't know about sending mails.

    Gerard
     
    Gerard Flanagan, Apr 8, 2006
    #2
    1. Advertising

  3. Guest

    Gerard,

    I tried to run your code but my interpreter couldn't locate the
    maildocument module. Is it included in Python standart library or
    should I install it from other place?

    Thanks,
    Tomer
     
    , Apr 9, 2006
    #3
  4. wrote:

    > Gerard,
    >
    > I tried to run your code but my interpreter couldn't locate the
    > maildocument module. Is it included in Python standart library or
    > should I install it from other place?
    >
    > Thanks,
    > Tomer


    Sorry Tomer,

    I was just suggesting you read it through as an example, didn't think
    you'd be interested in the whole shebang! PopClient was part of a
    half-baked project whose intent was to keep an eye on my technology-shy
    parents' emails and - wait for it - *post* them any attachments that
    were important!! Emails they can do, attachments not. But it was a good
    learning exercise.

    All the necessary files are here:

    http://gflanagan.net/site/python/pagliacci/

    Coming from C# I was used to 'one class - one file', but this will be
    updated one of these days.

    This is the particular file you want:

    http://gflanagan.net/site/python/pagliacci/MailDocument.html

    which requires:

    http://gflanagan.net/site/python/pagliacci/ElementWrapper.html

    and both these require the elementtree package which will soon be part
    of the standard library, but now you can get it here:

    http://effbot.org

    ( I also have a simple viewer based on XSLT, CherryPy and a CherryPy
    filter called Picket but it's not very sophisticated.)

    Hope that's enough to get you started.

    Gerard
     
    Gerard Flanagan, Apr 9, 2006
    #4
  5. Guest

    Thanks!
     
    , Apr 9, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leszek
    Replies:
    1
    Views:
    352
  2. Mike

    Receiving Email Attachments?

    Mike, Aug 11, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    409
  3. codewarrior
    Replies:
    0
    Views:
    539
    codewarrior
    May 4, 2009
  4. CS

    Not receiving all emails

    CS, Feb 24, 2006, in forum: ASP General
    Replies:
    1
    Views:
    128
    Anthony Jones
    Feb 24, 2006
  5. Replies:
    2
    Views:
    104
    Brian McCauley
    Apr 9, 2006
Loading...

Share This Page