|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Hi.
I've been messing around with imaplib some and I was wondering how to check if you are logged into a server. Does anyone know how to do this? Thanks in advance. ![]()
__________________
Before you criticize someone, walk a mile in their shoes, that way when you do criticize them, you're a mile away and you have their shoes! |
|
#2
|
|||
|
|||
|
Well, I have not messed around with imaplib but when you try to connect to a server:
m = imaplib.IMAP4(host="127.0.0.1",port=143) Will give you a connection refused if you can't connect. Just put the attempt to connect in a try block as in the example below... >>> try: ... m = imaplib.IMAP4(host="127.0.0.1",port=143) ... except: ... print("You were not logged in") ... You were not logged in >>> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > imaplib question... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|