Beginning Python by James Payne

Beginning Python by James Payne

Author:James Payne
Language: eng
Format: epub
Publisher: Wiley
Published: 2010-12-03T16:00:00+00:00


However, you probably don’t have a mail server running on your machine. (You might have one if you’re running these scripts on a shared computer, or if you set the mail server up yourself, in which case you probably already know a bit about networking and are impatiently waiting for the more advanced parts of this chapter.) If there’s no mail server on the machine where you run this script, you’ll get an exception when you try to instantiate the remote SMTP mail server object, something similar to this:

Traceback (most recent call last):

File "<pyshell#9>", line 1, in <module>

server=smtplib.SMTP("localhost",25)

File "C:\Python31\lib\smtplib.py", line 239, in __init__

(code, msg) = self.connect(host, port)

File "C:\Python31\lib\smtplib.py", line 295, in connect

self.sock = self._get_socket(host, port, self.timeout)

File "C:\Python31\lib\smtplib.py", line 273, in _get_socket

return socket.create_connection((host, port), timeout)

File "C:\Python31\lib\socket.py", line 307, in create_connection

raise error(msg)

socket.error: [Errno 10061] No connection could be made because the target machine actively refused it)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.