You Are Here:

Community: Developer Discussion Boards

#1 Old Question help... how to use POP3 in python?? - 2009-03-10, 16:35

Join Date: Mar 2009
Posts: 18
arie_8011
Offline
Registered User
any body know how to conect to mail server using pop3 in python??
like a mail client app...
Reply With Quote

#2 Old Re: help... how to use POP3 in python?? - 2009-03-10, 16:51

Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
Running from PC it is common to use poplib module. However, this module is not available for S60. I took a look at this module and I saw few dependencies:

Code:
re, socket, hashlib, sys
I suggest that you copy it from a standard Python distro (2.5.x) and test it with Python 1.9.2. Avoid SSL for a while and report results here ! (I can not make this test right now for you, unfortunately).


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote

#3 Old Re: help... how to use POP3 in python?? - 2009-03-12, 13:22

Join Date: Mar 2009
Posts: 18
arie_8011
Offline
Registered User
Quote:
Originally Posted by marcelobarrosalmeida View Post
Running from PC it is common to use poplib module. However, this module is not available for S60. I took a look at this module and I saw few dependencies:

Code:
re, socket, hashlib, sys
I suggest that you copy it from a standard Python distro (2.5.x) and test it with Python 1.9.2. Avoid SSL for a while and report results here ! (I can not make this test right now for you, unfortunately).

thanks for the respond marcelobarrosalmeida, but truely i'm a new bie in this.. i'm still confuse, what should i do...
would u mind to tell me more detail??
thank you for your humble heart...

(sory about my bad english)
Reply With Quote

#4 Old Re: help... how to use POP3 in python?? - 2009-03-12, 18:16

Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
Hi

Unfortunately, there is no easy way. You need to understand how pop3 works in order to receive messages and you need to understand how smtp works, for sending messages. And it is necessary to study poplib, of course.

I copied poplib from python 2.2.3 for you. Unzip and put this file inside "e:\python\lib" (memory card). Create this path, if it does not exist in your memory card.

Open python 1.4.5 and try the following code, just to get start:

Code:
import poplib
# put your pop3 mail server here
macc = poplib.POP3('mail.mail_server_here.com.br')
# put your username here
macc.user('username')
# put your password here
macc.pass_('password')
# macc.list return the email list
if macc.list():
    print "you have %d messages" % len(macc.list())
else:
    print "mailbox empty"
That is the better that I can do now. I hope it helps.

Marcelo Barros
Attached Files
File Type: zip poplib_python2.2.3.zip (3.2 KB, 32 views)


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote

#5 Old Re: help... how to use POP3 in python?? - 2009-03-14, 12:16

Join Date: Mar 2009
Posts: 18
arie_8011
Offline
Registered User
Quote:
Originally Posted by marcelobarrosalmeida View Post
Hi

Unfortunately, there is no easy way. You need to understand how pop3 works in order to receive messages and you need to understand how smtp works, for sending messages. And it is necessary to study poplib, of course.

I copied poplib from python 2.2.3 for you. Unzip and put this file inside "e:\python\lib" (memory card). Create this path, if it does not exist in your memory card.

Open python 1.4.5 and try the following code, just to get start:

Code:
import poplib
# put your pop3 mail server here
macc = poplib.POP3('mail.mail_server_here.com.br')
# put your username here
macc.user('username')
# put your password here
macc.pass_('password')
# macc.list return the email list
if macc.list():
    print "you have %d messages" % len(macc.list())
else:
    print "mailbox empty"
That is the better that I can do now. I hope it helps.

Marcelo Barros

thanks a lot marcelobarrosalmeida. you've help me a lot...
i understand it better now...
yes you are right, "there is no easy way". i will searcing or googling some tutorials, articles, or anything else related with pop3, smtp, and mail client..
btw, do you have some articles or anything about it??
i interested in study about it. and of course i love to study harder about something that i want to know...

thanks for helping me marcelobarrosalmeida...
Reply With Quote

#6 Old Re: help... how to use POP3 in python?? - 2009-03-14, 13:13

Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
Hi
Any good computer network book talks about pop and smtp. But you can start using some mediawiki articles and google. They are relatively simple protocols and can be used even over a regular telnet connection. Afterwards it will be simple to use the corresponding python modules.

See you
Marcelo Barros


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help installing Python libraries on S60 ericroijen Python 11 2009-07-18 11:43
Python for S60 1.9.2 released tvijayan Python 26 2009-03-11 10:28
Python for S60 1.9.1 released tvijayan Python 30 2009-02-26 07:16
Python for S60 1.9.0 released tvijayan Python 48 2009-01-27 16:39
[announce] Mobile Python book soon in Sept 2007 ! cyke64 Python 11 2007-10-03 20:46

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia