본문 바로가기
2013.04.06 10:23

Interactive POP3 Script

조회 수 3152 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print Files
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print Files
E-MailSendersandRecipientsontheInternet.Clientsdownloadandsendmailvia their MUAs, which talk to their corresponding MTAs. E-mail “hops” from MTA to MTA until it reaches the correct destination.

01.png

>>> from poplib import POP3
>>> p = POP3('pop.python.is.cool') 
>>> p.user('wesley')
'+OK'
>>> p.pass_("you'llNeverGuess")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.4/poplib.py", line 202,
     in pass_
        return self._shortcmd('PASS %s' % pswd)
File "/usr/local/lib/python2.4/poplib.py", line 165, in _shortcmd
return self._getresp()
File "/usr/local/lib/python2.4/poplib.py", line 141,
     in _getresp
         raise error_proto(resp)
poplib.error_proto: -ERR directory status: BAD PASSWORD >>> p.user('wesley')
'+OK'
>>> p.pass_('youllNeverGuess')
'+OK ready'
>>> p.stat()
(102, 2023455)
>>> rsp, msg, siz = p.retr(102)
>>> rsp, siz
('+OK', 480)
>>> for eachLine in msg:
...     print eachLine
...
Date: Mon, 26 Dec 2005 23:58:38 +0000 (GMT) 
Received: from c-42-32-25-43.smtp.python.is.cool
by python.is.cool (scmrch31) with ESMTP
id <2005122623583701300or7hhe>; Mon, 26 Dec 2005 23:58:37
+0000
From: wesley@python.is.cool
To: wesley@python.is.cool
Subject: test msg
xxx
.
>>> p.quit()
'+OK python.is.cool'

Title
List of Articles
번호 제목 글쓴이 날짜 조회 수
58 Python 2.7 in CentOS with no issue (setuptools, pip, virtualenv) Hojung 2014.08.31 3953
57 GUI 기본 file Hojung 2013.04.06 6163
56 Gmail SMTPx2, POP, IMAP Script Hojung 2013.04.06 3936
55 E-Mail 작성 및 발송 스크립트 Hojung 2013.04.06 4268
54 Interactive IMAP4 Script Hojung 2013.04.06 3605
53 SMTP and POP3 Script Hojung 2013.04.06 2646
» Interactive POP3 Script file Hojung 2013.04.06 3152
51 Interactive SMTP Script Hojung 2013.04.06 2588
50 FTP Download Script Hojung 2013.04.06 7689
49 SocketServer 모듈을 사용해 TCP Server/Client 작성 Hojung 2013.04.06 6006
48 Network Programming - socket() 모듈을 사용해 UDP Server, client 생성 Hojung 2013.04.06 5766
47 Network Programming - socket() 모듈을 사용해 TCP Server, client 생성 Hojung 2013.04.06 28852
46 brew install python on Mac OS X + pyqt, lxml and spynner Hojung 2013.03.29 5528
45 Regular Expression (search vs match 그리고 Greediness) file Hojung 2013.03.26 2831
44 Regular Expression - Extension Notations (?...) Hojung 2013.03.26 2651
43 Regular Expression (문자열을 RE를 이용 list 리턴) - split() Hojung 2013.03.26 3577
42 Regular Expression (찾기 및 바꾸기) - sub() and subn() Hojung 2013.03.26 2864
41 Regular Expression (찾기) - findall() and finditer() Hojung 2013.03.26 3791
40 Regular Expression (matching vs searching) Hojung 2013.03.23 9341
39 How to install pip, spynner, macports and py-pyqt4 Hojung 2013.03.22 3987
Board Pagination ‹ Prev 1 2 3 Next ›
/ 3

Designed by sketchbooks.co.kr / sketchbook5 board skin

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5