Skip to content

Instantly share code, notes, and snippets.

@jgriffyndor
Created June 29, 2020 17:03
import os
from flask import Flask, render_template, request, redirect, url_for, flash
from flask_mail import Mail, Message
app = Flask(__name__)
app.config['SECRET_KEY'] = 'top-secret!'
app.config['MAIL_SERVER'] = 'smtp.sendgrid.net'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = 'apikey'
app.config['MAIL_PASSWORD'] = os.environ.get('SENDGRID_API_KEY')
app.config['MAIL_DEFAULT_SENDER'] = os.environ.get('MAIL_DEFAULT_SENDER')
mail = Mail(app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment