smtplib.SMTP "no attributes SMTP"

Discussion in 'Python' started by Copelandia Cyanescens, Jul 31, 2004.

  1. 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
    Copelandia Cyanescens, Jul 31, 2004
    #1
    1. Advertising

  2. On Sat, 31 Jul 2004 13:32:59 -0400, rumours say that Copelandia
    Cyanescens <> might have written:

    >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.
    --
    TZOTZIOY, I speak England very best,
    "Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
    Christos TZOTZIOY Georgiou, Jul 31, 2004
    #2
    1. Advertising

  3. Christos TZOTZIOYGeorgiou wrote...

    > On Sat, 31 Jul 2004 13:32:59 -0400, rumours say that Copelandia
    > Cyanescens <> might have written:
    >
    >>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?


    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
    Copelandia Cyanescens, Jul 31, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Evan
    Replies:
    3
    Views:
    460
  2. zxo102
    Replies:
    5
    Views:
    984
    Tim Roberts
    Oct 2, 2008
  3. aberry
    Replies:
    0
    Views:
    612
    aberry
    Jan 20, 2009
  4. aberry
    Replies:
    0
    Views:
    1,049
    aberry
    Jan 21, 2009
  5. Gabriel Genellina

    Re: smtplib send email by using gmail smtp server

    Gabriel Genellina, May 3, 2009, in forum: Python
    Replies:
    0
    Views:
    430
    Gabriel Genellina
    May 3, 2009
Loading...

Share This Page