A
A
alcbo2keet4mu5e2021-05-30 18:29:29
HTML
alcbo2keet4mu5e, 2021-05-30 18:29:29

Image to email body PYTHON on Linux?

you need to embed a picture in the body of the letter (namely, in the letter itself, and not as an attachment to the letter) in python. I use Linux (Ubuntu)
Plus, everything needs to align the text and this picture in the center of my letter.
Also, add a hyperlink to another picture so that the picture is clickable.
I hope I expressed everything as detailed and intelligibly as possible, I am very, very weak in coding, but I am trying to become better) I will
attach part of the code:

# Optional. 
    "subject_header": bytes("Subject: КотБегемотэуэуэуэ\r\n", 'utf-8'), # Subject: hellso\r\n 
    "to_header": b"", # To: <[email protected]>\r\n 
    "body": bytes("<!DOCTYPE html> 
<html lang="en"> 
<head> 
  <meta charset="UTF-8">
  <title>Document</title> 
</head> 
<body> 
  <img src='/home/mkljuhjgh67888/kilujh111/lk787y.png'> 
</body> 
</html>\r\n", 'utf-8'), # Test Body. 
    # Optional. "raw_email": b"", }


Previously asked a question, one person advised to insert THIS in "body": bytes("...
But nothing happened, gave this error: "body": bytes(" Syntax Error: EOL while scanning string literal

PS Ubuntu 20.04

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question