Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Receiving emails with attachments

Reply
Thread Tools

Receiving emails with attachments

 
 
tomer.ha@gmail.com
Guest
Posts: n/a
 
      04-08-2006
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.

 
Reply With Quote
 
 
 
 
Gerard Flanagan
Guest
Posts: n/a
 
      04-08-2006
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/pag...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

 
Reply With Quote
 
 
 
 
tomer.ha@gmail.com
Guest
Posts: n/a
 
      04-09-2006
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

 
Reply With Quote
 
Gerard Flanagan
Guest
Posts: n/a
 
      04-09-2006
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/pag...lDocument.html

which requires:

http://gflanagan.net/site/python/pag...ntWrapper.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

 
Reply With Quote
 
tomer.ha@gmail.com
Guest
Posts: n/a
 
      04-09-2006
Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
receiving email/no sender address/no message/nosubject/no apparent attachments/size 5 kb irahanna@fortunehitech.net Computer Support 2 04-18-2007 12:16 PM
Receiving Email Attachments? Mike ASP .Net 0 08-11-2006 01:19 PM
Receiving emails with attachments tomer.ha@gmail.com Perl Misc 2 04-09-2006 06:13 PM
Receiving attachments Richard J Campisi Computer Support 3 12-21-2003 02:57 PM
Sending and receiving encrypted emails Leszek ASP .Net 1 12-16-2003 06:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57