poplib — POP3 protocol client.doc
上传人:sy****28 上传时间:2024-09-13 格式:DOC 页数:5 大小:55KB 金币:15 举报 版权申诉
预览加载中,请您耐心等待几秒...

poplib — POP3 protocol client.doc

poplib—POP3protocolclient.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

15 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

20.9.HYPERLINK\l"module-poplib"poplib—POP3protocolclientHYPERLINK\l"module-poplib"¶Sourcecode:HYPERLINK"http://hg.python.org/cpython/file/2.7/Lib/poplib.py"Lib/poplib.pyThismoduledefinesaclass,HYPERLINK\l"poplib.POP3"POP3,whichencapsulatesaconnectiontoaPOP3serverandimplementstheprotocolasdefinedinHYPERLINK"http://tools.ietf.org/html/rfc1725.html"RFC1725.TheHYPERLINK\l"poplib.POP3"POP3classsupportsboththeminimalandoptionalcommandsets.Additionally,thismoduleprovidesaclassHYPERLINK\l"poplib.POP3_SSL"POP3_SSL,whichprovidessupportforconnectingtoPOP3serversthatuseSSLasanunderlyingprotocollayer.NotethatPOP3,thoughwidelysupported,isobsolescent.TheimplementationqualityofPOP3serversvarieswidely,andtoomanyarequitepoor.IfyourmailserversupportsIMAP,youwouldbebetteroffusingtheHYPERLINK"http://docs.python.org/2/library/imaplib.html#imaplib.IMAP4"imaplib.IMAP4class,asIMAPserverstendtobebetterimplemented.TheHYPERLINK\l"module-poplib"poplibmoduleprovidestwoclasses:classpoplib.POP3(host[,port[,timeout]])HYPERLINK\l"poplib.POP3"¶ThisclassimplementstheactualPOP3protocol.Theconnectioniscreatedwhentheinstanceisinitialized.Ifportisomitted,thestandardPOP3port(110)isused.Theoptionaltimeoutparameterspecifiesatimeoutinsecondsfortheconnectionattempt(ifnotspecified,theglobaldefaulttimeoutsettingwillbeused).Changedinversion2.6:timeoutwasadded.classpoplib.POP3_SSL(host[,port[,keyfile[,certfile]]])HYPERLINK\l"poplib.POP3_SSL"¶ThisisasubclassofHYPERLINK\l"poplib.POP3"POP3thatconnectstotheserveroveranSSLencryptedsocket.Ifportisnotspecified,995,thestandardPOP3-over-SSLportisused.keyfileandcertfilearealsooptional-theycancontainaPEMformattedprivatekeyandcertificatechainfilefortheSSLconnection.Newinversion2.4.OneexceptionisdefinedasanattributeoftheHYPERLINK\l"module-poplib"poplibmodule:exceptionpoplib.error_protoHYPERLINK\l"poplib.error_proto"¶Exceptionraisedonanyerrorsfromthismodule(errorsfromHYPERLINK"http://docs.python.org/2/library/socket.html#