I have this script to send an email via SMTP:
import smtplib
smtpserver = 'smtp.server.com'
AUTHREQUIRED = 1# if you need to use SMTP AUTH set to 1
smtpuser = "username"# for SMTP AUTH, set SMTP username here
smtppass = "password"# for SMTP AUTH, set SMTP password here
RECIPIENTS ='[email protected]'
SENDER = '[email protected]'
mssg = open('filename.txt', 'r').read()
session = smtplib.SMTP(smtpserver)
if AUTHREQUIRED:
session.login(smtpuser, smtppass)
smtpresult = session.sendmail(SENDER, RECIPIENTS, mssg)
After running the script I get this error:
Traceback (most recent call last):
File "my_mail.py", line 14, in <module>
session.login(smtpuser, smtppass)
File "/usr/lib/python2.6/smtplib.py", line 589, in login
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, '5.7.0 Error: authentication failed:
authentication failure')
However there is no problem with my user/pass because I can login to my mail
account.
Thanks for any idea.
// Naderan *Mahmood;
--
http://mail.python.org/mailman/listinfo/python-list