September 22nd, 2004, 03:37 AM
e-mail to txt
conoscete una procedura o il codice che in autmatico trasferisca una e-mail in un file txt e suddivida i vari campi della e-mail
September 22nd, 2004, 03:50 AM
Sorry. Could you repost in english. This will give you a better chance of having your question answered since most people here speak english.
September 22nd, 2004, 03:54 AM
e-mail to txt
you know a procedure or the code that in autmatic transfers the content of an email in rows txt and subdivides several the fields of the email thanks
September 30th, 2004, 04:40 PM
That really depends on the content of the email, and how the email is stored.
If I understand you correctly, you want something like:
First, how does the email get to the Python program?
email -> python program -> text file with certain fields in it
Is it on a POP3 server? (See pop3lib)
Is it saved to a file? (Use file("filename.txt").readlines())
Is it stored in Microsoft Outlook? (See Win32 Extensions and COM automation)
Is it stored in some other email program? (Try to get it to a file).
Second, what is the content of the email?
If it is simple, you can probably write the parser yourself with simple if/then code and "if x in string" tests.
If it is CSV, see the CSV module.
If you just want parts of it at random, you might need Regular Expressions.
Sorry, there's no simple, automated way to do it.