python_wiki:send_email

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
python_wiki:send_email [2017/09/02 18:11]
billdozor created
python_wiki:send_email [2019/05/25 23:50] (current)
Line 32: Line 32:
 from email.mime.multipart import MIMEMultipart from email.mime.multipart import MIMEMultipart
 from email.mime.text import MIMEText from email.mime.text import MIMEText
 +
  
 #======================= #=======================
Line 40: Line 41:
 email_from="root@system01.example.com" email_from="root@system01.example.com"
  
 +
 +#=====================================
 +# Functions; Main starts after
 +#=====================================
 # Function: Send email # Function: Send email
 def send_email(send_from, send_to, subject, message): def send_email(send_from, send_to, subject, message):
Line 63: Line 68:
  
   return    return 
 +
  
 #=================== #===================
 # Main starts here # Main starts here
 #=================== #===================
 +
 +# Variables can be built by creating strings and adding to it. Example:
 +my_prebuilt_message = ""
 +my_prebuilt_message += "\n<li> Item 1 </li>"
 +my_prebuilt_message += "\n<li> Item 2 </li>"
  
 # Create HTML formatted message # Create HTML formatted message
  • python_wiki/send_email.1504390290.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)