Closed EddyMI3d closed 7 years ago
Thanks for the request. yagmail
evidently supports marking image attachments as inline images, but at a glance I can't quite figure out how to do so. Any ideas?
I've done a little research on this topic and this is what I've found ...
Since # 3 above gave the most useful behavior--usable in Thunderbird, if you ignore the broken image icon, and exactly how I want on mobile--I made the following modifications to the plugin in my local env to accomplish what I wanted (give explicit destination when GETing the snapshot image and use yagmail.inline with that file):
if snapshot_url:
try:
import urllib
filename, headers = urllib.urlretrieve(snapshot_url,"/tmp/snapshot.jpg")
except Exception as e:
self._logger.exception("Snapshot error (sending email notification without image): %s" % (str(e)))
else:
content.append(yagmail.inline(filename))
NOTE! since I used an explicit destination with urlretrieve, my changes are now platform-dependent. There is probably a better way to generate an explicit filename in a valid temporary location that would work for all platforms.
Hello!
Is it possible to send the image declared as embedded instead of attached. Not every email client shows an attached image. Thanks in advance. Eddy