title: How to adapt flask-mail to support two SMTP accounts
body: <p>I am using <a href="https://pythonhosted.org/Flask-Mail/" rel="nofollow noreferrer">flask-mail</a> to send from one account and it works fine. The unique information about multiple smtp accounts that I found in Google is this old <a href="https://github.com/jessepollak/blog/blob/master/_posts/2012-11-12-using-flask-mail-with-multiple-accounts.md" rel="nofollow noreferrer">comment</a>.</p>
  
  <p>What I have:</p>
  
  <pre><code>MAIL_USERNAME = config.get('mail_service', 'USER')
  MAIL_PASSWORD = config.get('mail_service', 'PASSWD')
  MAIL_SERVER = config.get('mail_service', 'MAIL_SERVER')
  MAIL_PORT = 587
  MAIL_USE_TLS = True
  
  mail = Mail()
  
  def create_app(config_name):
      app = Flask(__name__)
      mail.init_app(app)
      ...
  </code></pre>
  
  <hr>
  
  <pre><code>from flask_mail import Message
  @app.route("/")
  def index():
      msg = Message("Hello", sender="from@example.com", recipients=["to@example.com"])
  </code></pre>
  
  <p>I am not sure what is the best approach. Probably when sending each mail specify one of both configured SMTP accounts? </p>
  
  <p>Any idea how to implement that?</p>