AnsweredAssumed Answered

Python outlook smtp server connection

Question asked by awhitley67 on Sep 4, 2018
Latest reply on Sep 4, 2018 by rvburton

I have been trying to utilize Jake's solution located here https://community.esri.com/docs/DOC-10163-send-email-when-a-feature-is-added-to-a-arcgis-online-hosted-feature-service#c… to send an email from outlook when a new feature is added. However, I keep receiving the falling traceback error:

 

Traceback (most recent call last):
  File "C:\Users\twhitley\Documents\check_update2b.py", line 66, in <module>
    smtpObj.sendmail(FROM, TO, message)
  File "C:\Python27\ArcGIS10.3\lib\smtplib.py", line 723, in sendmail
    self.rset()
  File "C:\Python27\ArcGIS10.3\lib\smtplib.py", line 462, in rset
    return self.docmd("rset")
  File "C:\Python27\ArcGIS10.3\lib\smtplib.py", line 387, in docmd
    return self.getreply()
  File "C:\Python27\ArcGIS10.3\lib\smtplib.py", line 363, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
SMTPServerDisconnected: Connection unexpectedly closed

My python parameters for outlook are this:

fromEmail = 'awhitley@peachtree-city.org' # Email sender
toEmail = 'awhitley@peachtree-city.org'   # Email receiver
smtpServer = 'smtp-mail.outlook.com'    # SMPT Server Name
portNumber = 587                # SMTP Server port

Can someone point me in the right direction; the script Generates the token as expected but seems to hang at the SMTP settings. #

Outcomes