Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 2.7.5 (default, Aug 4 2017, 00:39:18)
- [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import smtplib
- >>> SERVER = smtplib.SMTP()
- >>> SERVER.connect('mail.devexchange.local')
- (220, 'interzone.devexchange.local Microsoft ESMTP MAIL Service ready at Mo n, 4 Jun 2018 19:58:21 -0500')
- >>> help(SERVER)
- >>> SERVER.help()
- 'This server supports the following commands:nHELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH BDAT'
- >>> help(SERVER)
- >>> SERVER.getreply()
- (451, '4.7.0 Timeout waiting for client input')
- >>>
- >>>
- >>>
- >>> SERVER.send('me@me.com', 'myemail@job.com', 'hello from smtp')
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: send() takes exactly 2 arguments (4 given)
- >>> SERVER.sendmail('me@me.com', 'myemail@job.com', 'hello from smtp')
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/usr/lib64/python2.7/smtplib.py", line 722, in sendmail
- self.ehlo_or_helo_if_needed()
- File "/usr/lib64/python2.7/smtplib.py", line 541, in ehlo_or_helo_if_needed
- if not (200 <= self.ehlo()[0] <= 299):
- File "/usr/lib64/python2.7/smtplib.py", line 412, in ehlo
- self.putcmd(self.ehlo_msg, name or self.local_hostname)
- File "/usr/lib64/python2.7/smtplib.py", line 340, in putcmd
- self.send(str)
- File "/usr/lib64/python2.7/smtplib.py", line 330, in send
- raise SMTPServerDisconnected('Server not connected')
- smtplib.SMTPServerDisconnected: Server not connected
- >>> SERVER.connect('mail.devexchange.local')
- (220, 'interzone.devexchange.local Microsoft ESMTP MAIL Service ready at Mo n, 4 Jun 2018 20:13:18 -0500')
- >>> SERVER.sendmail('me@me.com', 'myemail@job.com', 'hello from smtp')
- {}
- >>>
Add Comment
Please, Sign In to add comment