'Flask-mail how to embed image in html body
I'm using Flask-Mail to send emails with an html body. I would like to have a logo on top of the body but all I get is a question mark.
in the @app.route I tried this
//some code...
app.open_resource("LogoFatWatch2.0_50.png") as fp:
img=("LogoFatWatch2.0_50.png","image/png",fp.read())
msg.html = render_template('passwordReset.html', token=fullToken, img=img, username=username.usr_name)
the html file
<img style="padding-bottom: 50px; width: 50px;" src="{{img}}">
I also tried with the logo full path and even with the whole url but was unsuccessful. And {{url_for}} also doesn't work
If send it as an attachment it is visible but of course at the bottom of the email.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
