08-19-2008, 12:29 AM
I have a python script I want to run as a cron job. It needs to send a report via email to several addresses. Here is the relevant snippet of code:
==========================
pysmtp = smtplib.SMTP("mail.mydomain.net")
pysmtp.set_debuglevel(1) # trying to see what's goin' on
#pysmtp.ehlo()
#pysmtp.starttls()
pysmtp.ehlo()
pysmtp.docmd("AUTH PLAIN", base64.b64encode("\x00user@mydomain.net\x00password"))
#fails here ----> reply: retcode (535); Msg: Incorrect authentication data
#and this, of course, also fails
errDict = pysmtp.sendmail("user@mydomain.net", sendaddr, msg.as_string())
==========================
I've tried it both with and without starttls. Same result.
Could someone hit me with a cluestick? Is there something I need to do to set up a user to be able to send mail?
Regards
==========================
pysmtp = smtplib.SMTP("mail.mydomain.net")
pysmtp.set_debuglevel(1) # trying to see what's goin' on
#pysmtp.ehlo()
#pysmtp.starttls()
pysmtp.ehlo()
pysmtp.docmd("AUTH PLAIN", base64.b64encode("\x00user@mydomain.net\x00password"))
#fails here ----> reply: retcode (535); Msg: Incorrect authentication data
#and this, of course, also fails
errDict = pysmtp.sendmail("user@mydomain.net", sendaddr, msg.as_string())
==========================
I've tried it both with and without starttls. Same result.
Could someone hit me with a cluestick? Is there something I need to do to set up a user to be able to send mail?
Regards