Skip to content

leoscalco/EmailSender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EmailSender

A python application to send emails

Code based on this: http://naelshiab.com/tutorial-send-email-python/

Remember to allow "less secure apps" on Gmail

Simple mail
from EmailSender import *

emailsender = EmailSender('smtp.gmail.com', 587) # mail server, port 
emailsender.login("fromaddr@email.com", "password") # login with from, password
emailsender.send("toaddr@email.com", "body")  # to address, message
emailsender.quit() # logout
Sending attachments
from EmailSender import *

emailsender = EmailSender('smtp.gmail.com', 587) # mail server, port 
emailsender.login("fromaddr@email.com", "password") # login with from, password
emailsender.send_with_attachment("toaddr@email.com", "subject", "body", "file_path") # to, subject, body, path_file
emailsender.quit() # logout

About

A python application to send emails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages