Advertisement
Guest User

Untitled

a guest
Oct 13th, 2017
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. from smtplib import SMTP
  2. from mailgun import *
  3. from email.mime.text import MIMEText
  4. from email.mime.base import MIMEBase
  5. from email import encoders
  6. from os.path import join
  7.  
  8. def get_mime_message():
  9. """
  10. Sending using Python's MIME libraries to construct a
  11. message with attachments:
  12. """
  13. msg = MIMEText("""<html><body>Hi<br><a href="%unsubscribe_url%">domain u</a><br><a href="%tag_unsubscribe_url%">tag u</a></body></html>""", 'html')
  14. msg['Subject'] = 'Should be tag 33'
  15. msg['From'] = "me@defmailbox.com"
  16. msg['To'] = "klizhentas@gmail.com"
  17. msg['Content-Type'] = 'text/html'
  18. return msg.as_string()
  19.  
  20.  
  21. c = SMTP("smtp.definebox.com", 25)
  22. c.login("postmaster@ird.me", "70jbq78yqcu2")
  23. #c.login("postmaster@definebox.com", "9zjhdxk3ks90")
  24.  
  25. msg = '''From: ak@ird.me
  26. To: grubnospamplz@yahoo.com
  27. Subject: Hi
  28.  
  29. Hello, Sasha
  30. '''
  31.  
  32. c.sendmail("ak@deinfebox.com", ["alex@mailgun.net", "klizhentas@gmail.com"], get_mime_message())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement