Guest User

Untitled

a guest
Jan 17th, 2018
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #!/usr/bin/python
  2. #-*-coding: utf-8 -*-
  3. from email.MIMEText import MIMEText
  4. import smtplib
  5. import sys
  6. sender = 'test@domain.local' # От кого
  7. recivers = 'test2@domain.local' # Кому
  8. text = sys.argv[1]
  9. msg = MIMEText(text, "", "utf-8")
  10. msg["Subject"] = "Уведомление о пропущенном вызове"
  11. smtpObj = smtplib.SMTP('ex.domain.ru', 25)
  12. smtpObj.ehlo()
  13. smtpObj.starttls()
  14. smtpObj.login('test', '!Q2w3e4r-2015')
  15. smtpObj.sendmail(sender, recivers, msg.as_string())
  16. smtpObj.close()
  17.  
  18. [root@pbx-o ~]# python /usr/local/bin/sendmail.py qweqweq
  19. Traceback (most recent call last):
  20. File "/usr/local/bin/sendmail.py", line 21, in <module>
  21. smtpObj.login('test', '!Q2w3e4r-2015')
  22. File "/usr/lib64/python2.7/smtplib.py", line 584, in login
  23. raise SMTPException("SMTP AUTH extension not supported by server.")
  24. smtplib.SMTPException: SMTP AUTH extension not supported by server.
Add Comment
Please, Sign In to add comment