我有一个Yagmail脚本,我想发送一个这样的电子邮件:
你好!下面是一张图片。
img.png
再见!
但是,我的脚本只是在电子邮件底部一直发送图像。这是我的代码:
img = "img.PNG"
body = "Hello! Below is a picture." + img + "Goodbye!"
contents = [body, img]
yag.send("[email protected]", "Subject", contents)
您如何使用可以在文本块之间定位图像的格式发送电子邮件?帮助是appriciated!
contents = [yagmail.inline("/path/to/local/image")]