[Python] Data loss between raw email and text [closed]

Discussão em 'Python' iniciado por Stack, Outubro 6, 2024.

  1. Stack

    Stack Membro Participativo

    I have what seems like a really basic problem.. I read data from an email, and the data I am looking for is included, I then translate it to string and I lose part of it..

    I've tried using email.message_from_bytes and emailtext.decode as those seemed to have worked for others, but both have the same outcome.

    # Read the email file in binary mode with open('filename.eml', 'rb') as f: raw_email = f.read() print(raw_email) #data looks good here

    `# Parse the email
    msg = email.message_from_bytes(raw_email)
    print(msg) #data missing here`


    I have also tried msg = emailtext.decode('utf-8') and same data is missing here.

    Continue reading...

Compartilhe esta Página