Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Sending Emails

from redmail import EmailSender
from pathlib import Path

# Configure an email sender
email = EmailSender(
    host="<SMTP HOST>", port=0,
    user_name="me@example.com", password="<PASSWORD>"
)

# Send an email
email.send(
    sender="me@example.com",
    receivers=["you@example.com"],
    subject="An example email"
    attachments={
        "myfile.txt": Path("path/to/a_file.txt"),
        "myfile.html": "<h1>Content of a HTML attachment</h1>"
    }
)
Comment

PREVIOUS NEXT
Code Example
Python :: turtule code for digital clock 
Python :: add hours to date time in python 
Python :: dice rolling app in python 
Python :: longueur liste python 
Python :: Constructing a Class with __init__ function 
Python :: how to capture multiple screens with ImageGrab 
Python :: create matrix with complex python 
Python :: plot line2d on axis 
Python :: bill wiliams fractal python pandas 
Python :: Loop per n (batch) 
Python :: remove cooldown discord python 
Python :: pairwise swap in data structure in python 
Python :: how to export schema in graphene django 
Python :: Dist/Hist Plot Code in Seaborn 
Python :: pyglet on close 
Python :: ladnha; 
Python :: How to make bot commands case insensitive in discord.py 
Python :: read file in python 
Python :: Half String 
Python :: box detection 
Python :: python filter function 
Python :: python merge two byte files 
Python :: numpy np sign change in df pandas zero crossing 
Python :: delete csr python 
Python :: python three periods 
Python :: using a print function 
Python :: how to get rid of an instance variable python 
Python :: how to install python on visual studio code 
Python :: get value of a list of dictionary matching key 
Python :: get size of file python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =