471,092 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

smtplib "authentication required" error

In using a simple smtp routine:

# begin example
import smtplib
server = smtplib.SMTP('outgoing.verizon.net')
server.sendmail('m*@address.net', 'a******@address.net', """To: an*****@address.net
From: my@address.net
Subject: Shakespeare Quote

Tis like the breath of an unfeed lawyer...
""") server.quit()

# end example

I find the following error:

raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (550, '5.7.1 Authentication Required',
'm*******@verizon.net')
I have attempted to incorporate into the interactive session:

server.login = ('userid', 'password') # the same ones I use in my
email program

But I get the same error result. My objective is to have a simple way
to send email from the command line. To do this I will write a script
which can read in a file and send it to the address on top of the file.
What is the procedure for authentication?

Using the KMail email program (Linux, KDE desktop), I send mail through
my Verizon account. Under the Configure KMail / Accounts / Modify
Account / Extras tab, I clicked "Check what the server supports" and it
came back 'no encryption' and 'cleartext'. So it doesn't seem that it
would involve complex procedures.

Any help welcome.

Apr 1 '06 #1
2 6181
On 31 Mar 2006 18:20:27 -0800, ca**********@gmail.com
<ca**********@gmail.com> wrote:
In using a simple smtp routine:

# begin example
import smtplib
server = smtplib.SMTP('outgoing.verizon.net')
server.sendmail('m*@address.net', 'a******@address.net', """To: an*****@address.net
From: my@address.net
Subject: Shakespeare Quote

Tis like the breath of an unfeed lawyer...
""") server.quit()

# end example

I find the following error:

raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (550, '5.7.1 Authentication Required',
'm*******@verizon.net')
I have attempted to incorporate into the interactive session:

server.login = ('userid', 'password') # the same ones I use in my
email program


I had some trouble with this not too long ago. I don't know what kind
of authentication your mail server requires, but to send through gmail
I had to do the following.

s = smtplib.SMTP('smtp.gmail.com')
s.set_debuglevel(1)
s.ehlo()
s.starttls()
s.ehlo()
s.login('foo', 'bar')
s.sendmail(from_address, to_addresses, msg)
s.close()

Hope that helps.

--
Stand Fast,
tjg.
Apr 1 '06 #2
Dear tjg: That was extremely helpful. Thank you very kindly. The server
did not respond to the .starttls() method but authentication was
successful after, it seems, the .ehlo() was specified. I have tried the
script without the first s.ehlo() and without s.starttls() and it works
perfectly. My authentication problems seem to have been that the server
uses EHLO, which must be specified! Thank you very kindly.

Apr 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dave Hammond | last post: by
reply views Thread by VB Programmer | last post: by
reply views Thread by cher | last post: by
reply views Thread by 7stud | last post: by
reply views Thread by sa6113 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.