By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

smtplib "authentication required" error

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.