darkArp

Untitled

Jun 29th, 2018
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. try:
  2.  
  3.     from email.MIMEMultipart import MIMEMultipart
  4.     from email.MIMEText import MIMEText
  5. except:
  6.     from email.mime.multipart import MIMEMultipart
  7.     from email.mime.text import MIMEText
  8. import smtplib
  9. server = "smtp.gmx.com"
  10. username= "[email protected]"
  11. password = "Password123#"
  12.  
  13. mailfrom = "[email protected]"
  14.  
  15.  
  16. msg = MIMEMultipart()
  17. filename="text.txt"
  18. f = open(filename)
  19. attachment= MIMEText(f.read())
  20. attachment.add_header('Content-Disposition', 'attachment', filename=filename)
  21. msg.attach(attachment)
  22.  
  23.  
  24. mailer = smtplib.SMTP(server, 587)
  25. mailer.starttls()
  26. mailer.login(username, password)
  27. mailer.sendmail(mailfrom, mailto, msg.as_string())
  28. mailer.close()
Advertisement
Add Comment
Please, Sign In to add comment