Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from email.mime.text import MIMEText
- from email.mime.application import MIMEApplication
- from email.mime.multipart import MIMEMultipart
- from smtplib import SMTP
- import smtplib
- import sys
- import datetime
- def main(task , dest):
- mail_user="fypgp6@gmail.com"
- mail_pass="@Bcd123456"
- #emails = dest #tmp commented
- emails = 'fypgp6@gmail.com'
- msg = MIMEMultipart()
- msg['Subject'] = 'SMB Automatic Penetration Test'
- msg['From'] = mail_user
- msg['To'] = dest
- msg.preamble = 'Multipart massage.\n'
- part = MIMEText(str(datetime.datetime.now())+" Your job " + task + " is almost finish, please login to the system again and check the result")
- msg.attach(part)
- try:
- # server = smtplib.SMTP('smtp.office365.com',587,timeout=100)
- server = smtplib.SMTP('smtp.gmail.com',587)
- server.ehlo()
- server.starttls()
- server.login(mail_user, mail_pass)
- server.sendmail(msg['From'], emails , msg.as_string())
- server.quit()
- except:
- print '!!!err mssgg: ', sys.exc_info()
- print "error : cannot send the email to user"
- if __name__ == '__main__':
- main("auto exploit","waiming1999@gmail.com")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement