Last active
November 28, 2016 22:00
-
-
Save richardsonlima/35ec2175ef78ccfed24b1395c47ae5cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
import os | |
from email.MIMEText import MIMEText | |
fromaddr = '[email protected]' | |
toaddrs = '[email protected]' | |
from email.mime.multipart import MIMEMultipart | |
msg = MIMEMultipart() | |
msg['From'] = '[email protected]' | |
msg['To'] = '[email protected]' | |
msg['Subject'] = '[ Attention ] Email Flood Alert' | |
fp = open('/opt/zimbra/richardson-tricks/body.txt', 'r') | |
msg.attach(MIMEText(fp.read())) | |
fp.close() | |
#fp = open('/tmp/topMailsender-top15.log', 'r') | |
#msg.attach(MIMEText(fp.read())) | |
#fp.close() | |
# Credentials | |
password = 'SENHA' | |
# The actual mail send | |
server = smtplib.SMTP('server.mail.com:587') | |
server.starttls() | |
server.login(fromaddr,password) | |
server.sendmail(fromaddr, toaddrs, msg.as_string()) | |
server.quit() | |
print "done!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment