Do you feel like you’re not receiving enough emails in a day? Me too!
So I decided to try something out after seeing the Rythm Gmail node (wich unfortunatly doesn’t work anymore). I want to put a python script at the end of the graph I completed and that some cowerkers might use.
Each time a script is used, I’d receive an email stating the name of the script and the username of the current revit user. Including some special header to make sorting easier in outlook. That way I could eventually buld a database of usage or see that someone is strugging if he used it 20 times in 10 minutes.
following other threads I ended up with:
import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * import sys pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib' sys.path.append(pyt_path) import System import smtplib From =firstname.lastname@example.org Pswd ="password" To= email@example.com server = smtplib.SMTP('smtp.gmail.com', 587) #Next, log in to the server server.login(From,Pswd) #Send the mail msg = "Hello there!\n General Kenobi." server.sendmail(From, To, msg)
Wich throw me this error:
Avertissement:IronPythonEvaluator.EvaluateIronPythonScript l’opération a échoué.
Traceback (most recent call last):
File “C:\Program Files (x86)\IronPython 2.7\Lib\smtplib.py”, line 302, in connect
File “”, line 11, in
File “C:\Program Files (x86)\IronPython 2.7\Lib\smtplib.py”, line 242, in init
File “C:\Program Files (x86)\IronPython 2.7\Lib\smtplib.py”, line 277, in _get_socket
socket.error: getaddrinfo returns an empty list
I tried multiple other flavors of scripts I found online, including trying to connect directly throught the gmail IP. But to no avail, the same error eventually pop up and I have no idea what a socket is. Or’ they’d use some package that should be pip installed, wich I can’t do on every computer ever. (I can hardly do it on mine to begin with)
Has anyone solved this issue any other way? I’d settle for any method to send an mail, be it throught a mail server, a web-app or carrier pigeon.