yagmail icon indicating copy to clipboard operation
yagmail copied to clipboard

Issue with email formatting and inline usage

Open fabads opened this issue 5 years ago • 2 comments

Hello,

I would like to display an image in a table. I tried to used yagmail.inline but how can I embed this inline in a table or other customized email template in html format?

Regards

fabads avatar Oct 28 '19 10:10 fabads

Maybe try combining them? Untested:

yag = yagmail.SMTP(...)
yag.send(contents=["<table><tr><td>", 
                   yagmail.inline("link/to/image.png"), 
                   "</td></tr></table>"])

kootenpv avatar Oct 28 '19 15:10 kootenpv

Hello Pascal, I already tried this one but unfortunately not working. I was also planning to use a template library such as Mako to manage my email template.

eg, putting in the file:

<table>
  <tr>
    <td>${image}</td>
  </tr>
</table>

and replace variable information through the renderer of the template library.

fabads avatar Oct 28 '19 15:10 fabads