Guest User

Untitled

a guest
Jun 4th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. Python 2.7.5 (default, Aug 4 2017, 00:39:18)
  2. [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> import smtplib
  5. >>> SERVER = smtplib.SMTP()
  6. >>> SERVER.connect('mail.devexchange.local')
  7. (220, 'interzone.devexchange.local Microsoft ESMTP MAIL Service ready at Mo n, 4 Jun 2018 19:58:21 -0500')
  8. >>> help(SERVER)
  9.  
  10. >>> SERVER.help()
  11. 'This server supports the following commands:nHELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH BDAT'
  12. >>> help(SERVER)
  13.  
  14. >>> SERVER.getreply()
  15.  
  16.  
  17.  
  18. (451, '4.7.0 Timeout waiting for client input')
  19. >>>
  20. >>>
  21. >>>
  22. >>> SERVER.send('me@me.com', 'myemail@job.com', 'hello from smtp')
  23. Traceback (most recent call last):
  24. File "<stdin>", line 1, in <module>
  25. TypeError: send() takes exactly 2 arguments (4 given)
  26. >>> SERVER.sendmail('me@me.com', 'myemail@job.com', 'hello from smtp')
  27. Traceback (most recent call last):
  28. File "<stdin>", line 1, in <module>
  29. File "/usr/lib64/python2.7/smtplib.py", line 722, in sendmail
  30. self.ehlo_or_helo_if_needed()
  31. File "/usr/lib64/python2.7/smtplib.py", line 541, in ehlo_or_helo_if_needed
  32. if not (200 <= self.ehlo()[0] <= 299):
  33. File "/usr/lib64/python2.7/smtplib.py", line 412, in ehlo
  34. self.putcmd(self.ehlo_msg, name or self.local_hostname)
  35. File "/usr/lib64/python2.7/smtplib.py", line 340, in putcmd
  36. self.send(str)
  37. File "/usr/lib64/python2.7/smtplib.py", line 330, in send
  38. raise SMTPServerDisconnected('Server not connected')
  39. smtplib.SMTPServerDisconnected: Server not connected
  40. >>> SERVER.connect('mail.devexchange.local')
  41. (220, 'interzone.devexchange.local Microsoft ESMTP MAIL Service ready at Mo n, 4 Jun 2018 20:13:18 -0500')
  42. >>> SERVER.sendmail('me@me.com', 'myemail@job.com', 'hello from smtp')
  43. {}
  44. >>>
Add Comment
Please, Sign In to add comment