且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Python请求库在HTML中发送邮件内联图像

更新时间:2022-04-14 07:29:14

发送内联图像记录为此处

Sending Inline Images is documented here.

在HTML中,您将引用如下图像:

In the HTML, you'll reference the image like this:

<html>Inline image here: <img src="cid:test.jpg"></html>

然后,定义一个Multidict,将文件发布到API:

Then, define a Multidict, to post the files to the API:

files=MultiDict([("inline", open("files/test.jpg"))])

披露,我为Mailgun工作。 :)

Disclosure, I work for Mailgun. :)