in reply to reading body of email not working
The documentation of the top() method (which you are using to create $es) in Net::IMAP::Simple is quite clear. It doesn't return the body. Consider using the get() method or similar instead.