Mail-py
Python library for sending emails.
Installation
git clone https://github.com/SunPodder/Mail-py
cd Mail-py
python setup.py install
Usage
Import module and create instance:
from Mail import *
mail = Mail("[email protected]", "password")
Set receiver's email address and subject:
mail.receiver = "[email protected]" #Receiver's email address
mail.subject = "Demo Mail" #email subject
Send a simple email:
mail.addText("Hello world!\nThis is a test mail.\nHappy Coding!")
#adds text to email body
mail.send()
Send mail in HTML format:
mail.addHTML("<h1>This is a heading</h1>") #Adds HTML code to email body. Can be used for formatting emails.
mail.send()
Add files via email attachment:
mail.attach("image.jpg")
mail.send()