one problem about smtplib.py

Discussion in 'Python' started by Frank Zheng, May 13, 2004.

  1. Frank Zheng

    Frank Zheng Guest

    I wrote some code to test "smtplib", but i met a problem when i call the
    "login(user,pass)" of the "SMTP" object.
    here are the codes:

    >>> s = smtplib.SMTP()
    >>> s.set_debuglevel(1)
    >>> s.connect('smtp.263.net')

    connect: ('smtp.263.net', 25)
    connect: ('smtp.263.net', 25)
    reply: '220 Welcome to coremail System(With Anti-Spam) 2.1 for
    263(040326)\r\n'
    reply: retcode (220); Msg: Welcome to coremail System(With Anti-Spam) 2.1
    for 263(040326)
    connect: Welcome to coremail System(With Anti-Spam) 2.1 for 263(040326)
    (220, 'Welcome to coremail System(With Anti-Spam) 2.1 for 263(040326)')
    >>> s.login('Frank','*****')

    send: 'ehlo pc11.FutureDialChina.FutureDialChina.com\r\n'
    reply: '250-smtp.263.net\r\n'
    reply: '250-PIPELINING\r\n'
    reply: '250-SIZE 30720000\r\n'
    reply: '250-ETRN\r\n'
    reply: '250-AUTH LOGIN\r\n' # should be "250-AUTH PLAIN"
    reply: '250-AUTH=LOGIN\r\n'
    reply: '250-XVERP\r\n'
    reply: '250 8BITMIME\r\n'
    reply: retcode (250); Msg: smtp.263.net
    PIPELINING
    SIZE 30720000
    ETRN
    AUTH LOGIN
    AUTH=LOGIN
    XVERP
    8BITMIME
    AuthMethod: None
    Traceback (most recent call last):
    File "<interactive input>", line 1, in ?
    File "D:\tools\Python22\lib\smtplib.py", line 540, in login
    raise SMTPException("No suitable authentication method found.")
    SMTPException: No suitable authentication method found.

    I read the "login" of "smtplib" , I found it has two authentication method
    one is "PLAIN", the other is "CRAM-MD5", but the server's reply here didn't
    chose one of these two choices. I tested several mail-servers in China, they
    all just support "AUTH LOGIN". I found the Outlook use "AUTH LOGIN" and make
    it as standard.

    So I think smtplib maybe need do some changes, or someone has already did
    this work.

    Thanks
    Frank
    Frank Zheng, May 13, 2004
    #1
    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. Wayne Pierce
    Replies:
    1
    Views:
    2,459
    Daren Russell
    Jun 2, 2004
  2. Replies:
    3
    Views:
    460
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Mar 13, 2005
  3. Noah Gift

    smtplib problem for newbie

    Noah Gift, Jun 22, 2006, in forum: Python
    Replies:
    1
    Views:
    349
    Justin Azoff
    Jun 22, 2006
  4. Benedict Verheyen

    smtplib problem, Unable to relay for

    Benedict Verheyen, Dec 21, 2007, in forum: Python
    Replies:
    2
    Views:
    2,065
    Dennis Lee Bieber
    Dec 22, 2007
  5. Evan
    Replies:
    3
    Views:
    470
Loading...

Share This Page