I'm sending images as attachments using smtplib, and attaching them as email.mime.base.MIMEBase
objects. These images show up inline with the email body. I want these images to be clickable. Is it possible to add hrefs to each of these images?
Here's the code for attaching the image:
msg = MIMEMultipart()
msg['From'] = email_username
msg['To'] = ", ".join(destination_list)
msg['Subject'] = "Subject goes here"
message_body = "<b>Message body</b>"
msg.attach(MIMEText(message_body, 'html'))
part = MIMEBase('application', 'octet-stream')
part.set_payload(open('attachment.png','rb').read())
encoders.encode_base64(part)
part.add_header('Content-Disposition')
msg.attach(part)