Guest User

Untitled

a guest
Nov 5th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. import smtplib
  2.  
  3. if __name__ == '__main__':
  4.     try:
  5.         server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
  6.         server.ehlo()   # optional
  7.         # ...send emails
  8.         sent_from = "mikelovesoreos@gmail.com"
  9.         to = ["ca.stevenlam@gmail.com"]
  10.         subject = "Test email from python"
  11.         body = "This is a successful email!"
  12.         #TODO: Format body to incorproate the phishing site.
  13.  
  14.         email_text = """\
  15.        From: %s
  16.        To: %s
  17.        Subject: %s
  18.        %s
  19.        """ % (sent_from, ", ".join(to), subject, body)
  20.  
  21.         gmail_user = "mikelovesoreos@gmail.com"
  22.         gmail_pass = "telecomS144"
  23.         server.login(gmail_user, gmail_pass)
  24.         server.sendmail(sent_from, to, email_text)
  25.         server.close()
  26.  
  27.     except Exception as E:
  28.         print("Something went wrong - ", E)
Add Comment
Please, Sign In to add comment