Thread: e-mail to txt

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    2
    Rep Power
    0

    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
    grazie
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Sorry. Could you repost in english. This will give you a better chance of having your question answered since most people here speak english.

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    2
    Rep Power
    0

    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
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    34
    That really depends on the content of the email, and how the email is stored.

    If I understand you correctly, you want something like:

    Code:
    email -> python program -> text file with certain fields in it
    First, how does the email get to the Python program?
    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.

IMN logo majestic logo threadwatch logo seochat tools logo