Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: Recieving emails in python
Shane Geiger
1/14/2008 6:54:00 AM
mobiledreamers@gmail.com wrote:
> I m trying to create something simple a mailing list similar to yahoo
> groups
> I m stumbling at the part where the python recieves messages via say
> python@yahoogroups.com <mailto:python@yahoogroups.com>
>
> how to make python recieve emails and process it
> after that it is straight forward processing in python inserting in db etc
Can you use POP to access Yahoo groups?
If so, this script will get you started:
#!/usr/bin/python
"""
Redirect the output to a file to capture the contents of the mailbox.
"""
host = 'foo.com'
account = 'jennyjenny'
password = '8675309'
import getpass, poplib
M = poplib.POP3(host)
#M.user(getpass.getuser())
#M.pass_(getpass.getpass())
M.user(account)
M.pass_(password)
numMessages = len(M.list()[1])
for i in range(numMessages):
for j in M.retr(i+1)[1]:
print j
--
Shane Geiger
IT Director
National Council on Economic Education
sgeiger@ncee.net | 402-438-8958 |
http://ww...
Leading the Campaign for Economic and Financial Literacy
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Recieving emails in python
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password