I am trying to write a Python app that sends an e-mail alert. I am using the digi_smtplib.py file that is in the Dia /lib folder. When I try to create an instance of the digi_smtplib.SMTP(“locahost”) class, I got the following exception:
Exception in thread Thread-1:
Traceback (most recent call last):
File “./threading.py”, line 442, in __bootstrap
File “WEB/python/SMTPHandler.py”, line 32, in send_email
s = digi_smtplib.SMTP(“localhost”)
File “WEB/python/digi_smtplib.py”, line 255, in init
(code, msg) = self.connect(host, port)
File “WEB/python/digi_smtplib.py”, line 290, in connect
self.sock.connect((host, port))
File “”, line 1, in connect
error: (111, ‘Connection refused’)
The example in the documentation for the SMTP class uses “localhost”. Does the ConnectPort X4 not have an onboard SMTP server? I browsed the web site on my X4 but I did not see any settings for one.
If it does not have an onboard SMTP server, I could use gmail (http://mail.google.com/support/bin/answer.py?hl=en&answer=13287) but I think there are some issues with the digi_smtplib library. First, can the host name be a domain name (such as smtp.gmail.com)? Second, does it support authentication? Third, does it support STARTTLS?