settings network timeouts in python

N

Narendra

Hi All,

I have a problem here. I'm connecting to some pop server.Here i need to
set the network timeouts,since some times my program disconnecting from
net at tht point of time I'm unable to connect to POP server. Can any
one provide the solution for it.

code;

import poplib
m=poplib.POP3('pop.mail.yahoo.com',110)
m.user('XXX')
m.pass_('XXX')
# here i need to set the network time out when I'm connecting to POP
server. i.e in the line
m=poplib.POP3('pop.mail.yahoo.com')


Any help can be greatly appreciated

Thanks,
Narendra
 
S

Steve Holden

Narendra said:
Hi All,

I have a problem here. I'm connecting to some pop server.Here i need to
set the network timeouts,since some times my program disconnecting from
net at tht point of time I'm unable to connect to POP server. Can any
one provide the solution for it.

code;

import poplib
m=poplib.POP3('pop.mail.yahoo.com',110)
m.user('XXX')
m.pass_('XXX')
# here i need to set the network time out when I'm connecting to POP
server. i.e in the line
m=poplib.POP3('pop.mail.yahoo.com')


Any help can be greatly appreciated
Precede your code with

import socket
socket.setdefaulttimeout(60)

for a one-minute timeout.

Regarding your other problem, I don't know what will make a message be
classified as "bulk" by a particular receiving MTS, you'll have to ask
the operators of the mail server in question.

regards
Steve
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top