I'm able to compose a HTML-formatted body of an email with python and send it with Email+, but how do I include an image located in a certain folder?
My script in python2 used in Indigo7 does not work in Indigo 2022.2.
old method: (Don't remember where I found this coding, I'm not a programmer myself )
.....
theBody ="some text with HTML formatting"
theBody=theBody + "<p><img src='cid:image1'><br>"
theBody=theBody + "<img src='cid:image2'></p>"
msgText = MIMEText(theBody, 'html')
fp = open(os.path.expanduser("~/Documents/INDIGOplotD/Temperatuur-minute-S2.png"), "rb")
msgImage = MIMEImage(fp.read())
fp.close()
msgImage.add_header('Content-ID', '<image1>')
msgRoot.attach(msgImage)
fp = open(os.path.expanduser("~/Documents/INDIGOplotD/vermogen-minute-S2.png"), "rb")
msgImage = MIMEImage(fp.read())
fp.close()
msgImage.add_header('Content-ID', '<image2>')
msgRoot.attach(msgImage)
.......