Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

give colour to the font in python email message

import smtplib

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

msg = MIMEMultipart('alternative')

msg['Subject'] = "Link"
msg['From'] = "my@email.com"
msg['To'] = "your@email.com"

text = "Hello World!"

html = """
<html>
  <head></head>
  <body>
    <p style="color: red;">Hello World!</p>
  </body>
</html>
"""

part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')

msg.attach(part1) # text must be the first one
msg.attach(part2) # html must be the last one

s = smtplib.SMTP('localhost')
s.sendmail(me, you, msg.as_string())
s.quit()
Comment

PREVIOUS NEXT
Code Example
Python :: grouped box plot in python 
Python :: python arcade sound 
Python :: pyspark rdd method 
Python :: change the surface color rhinopython 
Python :: calculate speed with time in datetime python 
Python :: WAP which defines and calls a function that receives an octal number and prints the equivalent number bases i.e. in decimal, binary and hexadecimal equivalents. 
Python :: if user_answer==answer: ecpeted index erroe pythin fx 
Python :: What is the purpose of open ( ) and close ( ) in os 
Python :: finns = False 
Python :: houghlinesp python stackoverflow 
Python :: split dat file into datafram in python 
Python :: returns the dataframe with the modified Title column in which the updated groupings are reflected. 
Python :: ordereddict move to end 
Python :: dashbars detect first loop 
Python :: quando è stata inventata la lavastoviglie 
Python :: create a variable python 
Python :: python selenium login button class click 
Python :: Return an RDD created by coalescing all elements within each partition into a list. 
Python :: Returns the cartesian product with another DataFrame 
Python :: staff user is not restricting permission in django 
Python :: matplot lib mehrere bilder nebeneinander 
Python :: dream manhunt 
Python :: hashing in python using quadratic probing 
Python :: python set class variable 
Python :: rfe = RFE(lr, n_features_to_select=9) rfe.fit(X,Y) 
Python :: tf.slice 
Python :: pandas boolean array calculating the average of two columns based on a filter or a 3rd column 
Python :: helper for FastAPI Users to create a super user 
Python :: Inpunt and output 
Python :: python to java converter online 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =