python-guerrillamail icon indicating copy to clipboard operation
python-guerrillamail copied to clipboard

Email's Body show as None

Open LeoDOD opened this issue 6 years ago • 5 comments

Hi! I'm trying to use the GuerrillaMailSession to generate an email and retrieve a verify your email message, but every time i retrieve the emails Body it returns as being None, is there any reason this could happen?

LeoDOD avatar Mar 26 '19 17:03 LeoDOD

Can you provide a code example to demonstrate the issue you are having?

ncjones avatar Mar 28 '19 09:03 ncjones

Sure can! # We set our Guerrilla email. email_session = GuerrillaMailSession() temp_email = email_session.get_session_state()['email_address'] sleep(15) for x in iter(context.email_session.get_email_list()): print(x.body) I have some Code in between that handles the Registration in the page, other than that thats all im doing. There results of the print returns this for the latest email None And this for the regular guerrilla email:

Dear Random User,

Thank you for using Guerrilla Mail - your temporary email address friend and spam fighter's ally!...

LeoDOD avatar Mar 28 '19 13:03 LeoDOD

The "list messages" API call does not include message bodies. You will need to call the "get message" API for each message you need the body for.

Sorry l should have added API docs in the readme so this is clearer.

ncjones avatar Mar 29 '19 04:03 ncjones

Could you give me an example? Do you mean i would have to do a request to the api itself and not use the repo the GuerrillaMailSession() for me to be able to see the body of each message?

LeoDOD avatar Mar 29 '19 12:03 LeoDOD

email_summary = email_session.get_email_list()[0]
email = email_session.get_email(email_summary.guid)
print email.body

ncjones avatar Mar 30 '19 03:03 ncjones