Python Email send script
1 post
• Page 1 of 1
Python Email send script
Hi I am trying to make python program to send email. I am modeling in Autodesk maya software and i want when the render of my model is complete it should email me the log, i hav scripted till when to send email and prepare a log but this python script doesnt seems to work out fine
Autodesk Maya supports Maya embedded language and Python for scripting inside it
- Code: Select all
import smtplib
AUTHREQUIRED = 1 # if you need to use SMTP AUTH set to 1
smtpuser = 'user@gmail.com' # for SMTP AUTH, set SMTP username here
smtppass = 'mypass' # for SMTP AUTH, set SMTP password here
RECIPIENTS = ['tomyself@gmail.com']
SENDER = 'san@skvfx.com'
mssg = open('C:/Documents and Settings/san/Desktop/render.log', 'r').read()
session = smtplib.SMTP('smtp.gmail.com', 465)
if AUTHREQUIRED:
session.login(smtpuser, smtppass)
smtpresult = session.sendmail(SENDER, RECIPIENTS, mssg)
if smtpresult:
errstr = ""
for recip in smtpresult.keys():
errstr = """Could not delivery mail to: %s
Server said: %s
%s
%s""" % (recip, smtpresult[recip][0], smtpresult[recip][1], errstr)
raise smtplib.SMTPException, errstr
1 post
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 6 guests