Complete the code to import the Flask-Mail extension.
from flask_mail import [1]
The correct class to import from flask_mail is Mail. This class helps us send emails from Flask.
Complete the code to create a Flask-Mail instance with the Flask app.
mail = [1](app)We create a Flask-Mail instance by calling Mail(app), passing the Flask app object.
Fix the error in the configuration key for the mail server address.
app.config['MAIL_[1]'] = 'smtp.example.com'
The correct configuration key uses 'MAIL_SERVER' to specify the mail server address.
Fill both blanks to set the mail username and password in the Flask app config.
app.config['MAIL_[1]'] = 'user@example.com' app.config['MAIL_[2]'] = 'securepassword'
The correct keys are 'MAIL_USERNAME' and 'MAIL_PASSWORD' to set the email login credentials.
Fill all three blanks to create and send a simple email message using Flask-Mail.
from flask_mail import Message msg = Message(subject='Hello', sender='from@example.com', recipients=['to@example.com']) msg.body = '[1]' with app.app_context(): [2].send([3])
The message body is set to a string. The mail instance calls send with the message object.