но в Gmail написано, что изображение прикреплено, мне это не нужно, мне нужно только изображение тело письма.
Код: Выделить всё
html_content=f"
[img]cid:banner[/img]
"
msg = MIMEMultipart('related')
html_part = MIMEText(html_content, 'html')
msg.attach(html_part)
with open(image_path, 'rb') as f:
image_data = f.read()
image_attachment = MIMEImage(image_data,'html', name='Logo')
image_attachment.add_header('Content-ID','') # Unique identifier for the image
msg.attach(image_attachment)
# Subject of E-mail
msg['Subject'] = f"Aire Frio Maracay ❄"
# Sender E-mail Id
sender = 'administracion@airefriomaracay.com'
msg['From'] = sender
# Receiver E-mail Id
recipient = 'salemmakansi19@gmail.com'
msg['To'] = recipient
# SMTP Server
server = smtplib.SMTP_SSL('smtp.zoho.com', 465)
# SMTP Server Login Credentials
server.login(sender, 'gYDY04USz6ru')
# Gives Send Mail Request to SMTP Server
server.sendmail(sender, recipient, msg.as_string())
# Quit or Logout from SMTP Server
server.quit()
Я просто хочу этого
Я попробовал поискать на YouTube и спросить Gemini IA, но я не нашел решения
Подробнее здесь: https://stackoverflow.com/questions/787 ... thon-flask