title: Flask Mail: how to add custom name to the sender?
body: <p>I'm using Flask mail to send emails. Everything works fine except I noticed the sender name is just a first part of email like (1) - "info" in this case:</p>
  
  <p><a href="https://i.stack.imgur.com/WSrR4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WSrR4.png" alt="enter image description here"></a></p>
  
  <p>How to add a custom name like (2) - see the screenshot?</p>
  
  <p>The code I'm sending emails with:</p>
  
  <pre><code>def send_async_email(app, msg):
      with app.app_context():
          mail.send(msg)
  
  
  def send_email(to, subject, template, **kwargs):
      app = current_app._get_current_object()
      msg = Message(app.config['MAIL_SUBJECT_PREFIX'] + ': ' + subject,
                  sender=app.config['MAIL_DEFAULT_SENDER'] , recipients=[to])
      msg.body = render_template(template + '.txt', **kwargs)
      msg.html = render_template(template + '.html', **kwargs)
      thr = Thread(target=send_async_email, args=[app, msg])
      thr.start()
      return thr
  </code></pre>