Skip to content

Instantly share code, notes, and snippets.

View ldmontibeller's full-sized avatar

Leonardo Drews Montibeller ldmontibeller

View GitHub Profile
@bryhal
bryhal / send_email2.py
Created November 4, 2012 01:04
PYTHON: SMTP Email with HTML and Multiple Attachments
# 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]'
@turicas
turicas / email_utils.py
Last active August 1, 2024 15:47
Send emails easily in Python (with attachments and multipart)
#!/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