Complete the code to import the Flask mail extension.
from flask_mail import [1]
The Flask-Mail extension is imported using Mail. This allows sending emails in Flask apps.
Complete the code to configure the mail server in Flask app.
app.config['MAIL_SERVER'] = '[1]'
For sending emails via Gmail, the mail server is smtp.gmail.com.
Fix the error in creating the email message object.
msg = Message(subject='Hello', sender='[1]', recipients=['user@example.com'])
The sender email should be a valid sender address like noreply@example.com to avoid errors.
Fill both blanks to send an email with Flask-Mail.
mail = [1](app) mail.[2](msg)
First, create a Mail object with the app, then call send method to send the message.
Fill all three blanks to create a dictionary comprehension filtering emails with 'gmail.com'.
filtered_emails = {email: [1] for email in emails if [2] in email and email.endswith('[3]')}This comprehension creates a dictionary with emails as keys and their length as values, filtering emails containing '@' and ending with 'gmail.com'.