I have a script written in Python that sends emails. And I want to link to another site in the text of the letter up to one word. That is, when a user reads a letter and clicks on a word (for example, a link), he goes to my site. How can this be done in Python?

  • Python has nothing to do with it. Send html-letter. - Vladimir Martyanov
  • Here is a (more complicated) example of how to send a letter in Python containing simple text (for people who disable HTML in email clients) and HTML with an embedded image. Only a <a href="..">ссылку</a> much easier to add. You can MIMEText('<a>..', 'html') even without MIMEMultipart() ). - jfs
  • Could you tell me by following the example below? a> when a letter arrives in the mail then there is no picture. Instead, the box with the icon of the damaged file - zizda

1 answer 1

Insert html in the letter

For example:

 <html> <head></head> <body> <a href="http://mywebsite.com">myWebsite</a> </body> </html> 
  • Could you tell me by following the example below? a> when a letter arrives in the mail then there is no picture. Instead, the box with the icon of the damaged file - zizda