Skip to content

Instantly share code, notes, and snippets.

View broland07's full-sized avatar
🏠
Working from home

Balla Roland broland07

🏠
Working from home
View GitHub Profile
#!/bin/bash
# Email setup
SENDGRID_API_KEY="SG.xxxxxx"
FILENAME_ATTACH="bash test file"
FILENAME_ZIP="test.txt"
FILENAME_BASE64_TMP="test.txt"
EMAIL_TO="[email protected]"
EMAIL_SUBJECT="test bash file"
EMAIL_FROM="[email protected]"
@broland07
broland07 / sendgrid_email.py
Created January 24, 2021 11:03
Make sure you have the SENDGRID_API_KEY environment variable set. (export SENDGRID_API_KEY="SG.xxxxxxxx")
import os
import base64
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import (Mail, Attachment, FileContent, FileName, FileType, Disposition)
message = Mail(
from_email='[email protected]',
to_emails='[email protected]',