To send emails, we need to install the Flask-Mail flask extension using the below-given command.
pip install Flask-Mail
Once installed, then we need to use Flask Config API to configure MAIL-SERVER, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, etc. Then we need to import Message Class, instantiate it and form a message object before sending the email by using the mail.send() method.