Socket Timeout and SMTP

Discussion in 'Python' started by Tim Williams, Jul 23, 2004.

  1. Tim Williams

    Tim Williams Guest

    (python newbie)

    Is it possible to individually set the socket timeout of a connection
    created by smtplib, rather than use the socket.setdefaulttimeout() value
    used by the rest of the prog/script?

    eg:

    import smtplib
    import (other stuff)

    socket.setdefaulttimeout(90)

    class class1():
    ..
    ..
    smtp_client( some vals )
    ..

    class class2():
    ..
    ..
    smtp_client( some vals )
    ..

    def smtp_client(mx, from, to_list, msg):
    server = smtplib.SMTP(mx)
    (set socket timeout to XX)
    failed = mxserver.sendmail(from, to_list , msg)
    ...
    ...


    def Start():
    .....


    if __name__ == '__main__':
    Start()


    TIA

    Tim
     
    Tim Williams, Jul 23, 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. Tim Williams

    Re: Socket Timeout and SMTP

    Tim Williams, Jul 23, 2004, in forum: Python
    Replies:
    0
    Views:
    646
    Tim Williams
    Jul 23, 2004
  2. p.
    Replies:
    4
    Views:
    599
    Giampaolo Rodola'
    Jan 10, 2009
  3. Laszlo Nagy
    Replies:
    1
    Views:
    4,874
    Mark Wooding
    Jan 27, 2009
  4. Jean-Paul Calderone
    Replies:
    0
    Views:
    979
    Jean-Paul Calderone
    Jan 27, 2009
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,298
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page