Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import smtplib
- sender = 'email@mydomain.com'
- receivers = ['thisemail@yahoo.com']
- message = """From: email <email@mydomain.com>
- To: Jac <mygmail@gmail.com>
- Subject: Test
- 222
- Yep in the inbox?
- """
- try:
- s = smtplib.SMTP('mail.mydomain.com')
- s.sendmail(sender, receivers, message)
- print "Successfully sent email"
- except smtplib.SMTPException:
- print "Error: unable to send email"
- MAIL_SERVER = "mail.mydomain.com"
- MAIL_PORT = 25
- MAIL_USE_SSL = False
- MAIL_USE_TLS = True
- MAIL_USERNAME = os.environ["MAIL_USERNAME"]
- MAIL_PASSWORD = os.environ["MAIL_PASSWORD"]
- MAIL_DEBUG = True
- MAIL_DEFAULT_SENDER = '"Newsletter" <email@mydomain.com>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement