5

I have a Yagmail script where I want to send an email formated like so:

Hello! Below is a picture.

img.png

Goodbye!

However, my script is just sending the image all the way at the bottom of the email. Here is my code:

img = "img.PNG"
body = "Hello! Below is a picture." + img + "Goodbye!"

contents = [body, img]
yag.send("receiver@gmail.com", "Subject", contents)

How would you send an email using a format where you can position the image between blocks of text? Help is appriciated!

Bryan Thai
  • 179
  • 1
  • 2
  • 8

1 Answers1

1
contents = [yagmail.inline("/path/to/local/image")]
Daniel Cottone
  • 4,257
  • 24
  • 39
Zou Angus
  • 21
  • 3