I have a mysql database with email addresses and other data. I need to create specific emails which could be sent to the addresses in the db. The type of email will vary depending on the fields on the db. Each email message will have a pdf attachment taken from a path field in the db. As the emails need to be sent from another computer I have thought of creating an mbox file containing the messages and attachments as base64 ASCII text, which can then be opened in an email program such as evolution and sent from the other computer. I need to get advice and possible examples of how this can be done using python and mysql. Examples of how to convert a email address, message body text and pdf to a ASCII text mbox file would be ideal. Thanks.
↧