A better handling of attachments

The prior method did not function very well with HTML emails which also have attachments in them. The Mailgun API allows for these, so I've adjusted to include them.
Do you think all the stuff above should be wrapped in try: except? I'm sure many parts can be excluded here, if not all. IMHO.