smtplib.SMTP "no attributes SMTP"

  • Thread starter Copelandia Cyanescens
  • Start date
C

Copelandia Cyanescens

Python Python 2.3.4, Windows, "clean" install, using the example code
given in the documentation, I get this...

Traceback (most recent call last):
File "C:\projects\email\email.py", line 24, in ?
server = smtplib.SMTP('mail.xxxxx.xxx')
AttributeError: 'module' object has no attribute 'SMTP'

I beg to differ, it most certainly does. Right? :)

TIA

--
"I spent several years in a North Vietnamese prison camp, in the
dark, fed with scraps. Do you think I want to do that all over
again as vice president of the United States?"

-- Sen. John McCain
 
C

Christos TZOTZIOY Georgiou

Python Python 2.3.4, Windows, "clean" install, using the example code
given in the documentation, I get this...

Traceback (most recent call last):
File "C:\projects\email\email.py", line 24, in ?
server = smtplib.SMTP('mail.xxxxx.xxx')
AttributeError: 'module' object has no attribute 'SMTP'

Have you created a file smtplib.py somewhere in your python path?
Perhaps you named as such the file with the example code from the
documentation?
I beg to differ, it most certainly does. Right? :)

Yes, the std lib smtlib.py does have an SMTP class.
 
C

Copelandia Cyanescens

Christos TZOTZIOYGeorgiou wrote...
Have you created a file smtplib.py somewhere in your python path?
Perhaps you named as such the file with the example code from the
documentation?

No, I saved the code as email.py... BUT... you hit the nail on the head
with the file name suggestion. The error disappears if I rename to
something like abcdef.py. I'll bet dollars to doughnuts that smtplib
references a module called email.py, huh? <grin>

Thanks! I knew it had to be something obvious and easy. :)

--
"I spent several years in a North Vietnamese prison camp, in the
dark, fed with scraps. Do you think I want to do that all over
again as vice president of the United States?"

-- Sen. John McCain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top