Close the connection to the SMTP server.
(self)
| 987 | rcpt_options) |
| 988 | |
| 989 | def close(self): |
| 990 | """Close the connection to the SMTP server.""" |
| 991 | try: |
| 992 | file = self.file |
| 993 | self.file = None |
| 994 | if file: |
| 995 | file.close() |
| 996 | finally: |
| 997 | sock = self.sock |
| 998 | self.sock = None |
| 999 | if sock: |
| 1000 | sock.close() |
| 1001 | |
| 1002 | def quit(self): |
| 1003 | """Terminate the SMTP session.""" |