Skip to content

Instantly share code, notes, and snippets.

@jostster
jostster / send_email.py
Created Apr 29, 2016 — forked from thinrhino/send_email.py
Send mails using Mandrill API
View send_email.py
from mandrill import Mandrill
import base64
mail_client = Mandrill('<api_key>')
frm_email = 'email@email.com'
frm_name = 'Given Name'
# Sending image as attachment
img_attachment = base64.b64encode(open('~/sample_image.jpg', 'rb').read())