Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- from sys import argv
- SMTPserver = '172.25.1.63'
- sender = '[SPOA::DIMAR-CIOH] <[email protected]>'
- USERNAME = "WilderXXXXXXn"
- PASSWORD = "WNCPXXXXX"
- text_subtype = 'plain'
- # content="""\
- # Test Test Test
- # """
- content = argv[1]
- subject = "::. SPOA Status .:: " + argv[2]
- import sys
- import os
- import re
- # from smtplib import SMTP_SSL as SMTP
- from smtplib import SMTP
- from email.MIMEText import MIMEText
- try:
- msg = MIMEText(content, text_subtype)
- msg['Subject'] = subject
- msg['From'] = sender
- conn = SMTP(SMTPserver)
- conn.ehlo()
- conn.starttls()
- conn.ehlo()
- conn.set_debuglevel(False)
- conn.login(USERNAME, PASSWORD)
- try:
- conn.sendmail(sender, destination, msg.as_string())
- finally:
- conn.close()
- except Exception, exc:
- sys.exit( "mail failed; %s" %str(exc) )
Advertisement
Add Comment
Please, Sign In to add comment