This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Found most ofthis at http://ryrobes.com/python/python-snippet-sending-html-email-with-an-attachment-via-google-apps-smtp-or-gmail/ | |
# Adapted to accept a list of files for multiple file attachments | |
# From other stuff I googled, a little more elegant way of converting html to plain text | |
# This works in 2.7 and my brain gets it. | |
######### Setup your stuff here ####################################### | |
attachments = ['test_pdf.pdf', 'test_waiver.pdf'] | |
username = '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# This little project is hosted at: <https://gist.github.com/1455741> | |
# Copyright 2011-2020 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
import os | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText |