code: def init_app(self, app):
          
          state = self.init_mail(app.config, app.debug, app.testing)
  
          # register extension with app
          app.extensions = getattr(app, 'extensions', {})
          app.extensions['mail'] = state
          return state
docs: Initializes your mail settings from the application settings.
  
          You can use this if you want to set up your Mail instance
          at configuration time.
  
          :param app: Flask application instance