There is some ability to send mail from the bot, but if you have the interest to do it better yourself, here is how you interact with a mailbox via a plugin...
If you are close enough to a mailbox, and have the Postal addon installed, this code will click the "Open All" button.
Use a different addon like Bulkmail where you set up what and who you want to send to, modify the last line and you can quite easily automate sending mail.