Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from smtplib import SMTP
- from mailgun import *
- from email.mime.text import MIMEText
- from email.mime.base import MIMEBase
- from email import encoders
- from os.path import join
- def get_mime_message():
- """
- Sending using Python's MIME libraries to construct a
- message with attachments:
- """
- 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')
- msg['Subject'] = 'Should be tag 33'
- msg['From'] = "me@defmailbox.com"
- msg['To'] = "klizhentas@gmail.com"
- msg['Content-Type'] = 'text/html'
- return msg.as_string()
- c = SMTP("smtp.definebox.com", 25)
- c.login("postmaster@ird.me", "70jbq78yqcu2")
- #c.login("postmaster@definebox.com", "9zjhdxk3ks90")
- msg = '''From: ak@ird.me
- To: grubnospamplz@yahoo.com
- Subject: Hi
- Hello, Sasha
- '''
- c.sendmail("ak@deinfebox.com", ["alex@mailgun.net", "klizhentas@gmail.com"], get_mime_message())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement