473,498 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Receiving emails with attachments

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 '06 #1
4 2128
to******@gmail.com 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

Apr 8 '06 #2
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 '06 #3
to******@gmail.com 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

Apr 9 '06 #4
Thanks!

Apr 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1411
by: Jules Mitland | last post by:
I dont have Jmail v4 due to ISP limitations. Is there any other way I can decode an email to save the attachments? I can do the first part of saving the emails using Perl. Is it possible to use any...
5
2955
by: horsetransport | last post by:
Hello, Below is what I "Know how to do" but it doesn't accomplish what I want I have table called sndmail fields that matter useremail and mailsent
1
3028
by: JohnRHarlow | last post by:
Hi: I am looking for advice on the best way to set up a process to read incoming emails (from a normal unix mailbox on the same host) containing a gzipped telemetry attachment. I'd like the...
7
3937
by: Marek Bakalarczuk | last post by:
Hi. I want to make A Document Management System. Everything is fine and beautyfull but... how to hell I can receive emails with attachements, and how to store it in Access database table. I'm...
1
7005
by: PhilD | last post by:
My C#.NET console app checks a public folder every 24 hours for incoming emails. For each unread email in the folder, it copies any attachments to the network, then loads the contents of these files...
5
1433
by: sck10 | last post by:
Hello, I am working on a new project where I need to: 1. open an email and then create an xml file from the email 2. open the xml file and parse the information. I would like to be able to do...
3
1535
by: lizii | last post by:
Hey there - hopefully last newbie question i will ask for a while! I want my application to work where you click a button - and it either: a) open a email application - insert the correct email...
0
2764
by: sachintandon | last post by:
Hello all, Thanks in advance for your help I have a problem in sending emails, my requirement is to send multipart alternative emails with attachments, I'm able to send text with attachments or...
0
3408
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.