473,752 Members | 9,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code to retrieve web mail?

I have a free web mail address and would like to use python to retrieve
files that have been emailed to me. The basic code would accommodate
cookies, a login name and password, then download using the full URL I
can provide. From postings here I thought mechanize held promise, but
I've found it to contain filenames that are invalid for MSDOS (too many
characters, and/or too many dots in the name, etc.) so I have little hope
that the mechanize module can be used.

I'm running python2.4.2 on plain MSDOS (not windows), so would appreciate
a pointer to sample code that can do the job. I know that curl has this
capability, but I'll learn something by tinkering with python code.

Thanks.
--
John Savage (my news address is not valid for email)
Aug 1 '06 #1
4 2354
On Tue, 2006-08-01 at 01:47 +0000, John Savage wrote:
I have a free web mail address and would like to use python to retrieve
files that have been emailed to me. The basic code would accommodate
cookies, a login name and password, then download using the full URL I
can provide. From postings here I thought mechanize held promise, but
I've found it to contain filenames that are invalid for MSDOS (too many
characters, and/or too many dots in the name, etc.) so I have little hope
that the mechanize module can be used.

I'm running python2.4.2 on plain MSDOS (not windows), so would appreciate
a pointer to sample code that can do the job. I know that curl has this
capability, but I'll learn something by tinkering with python code.
PyCurl certainly does have that capability, although the docs were
practically non-existent last I looked (and I've not tried it on DOS).
Still Google will help get you through it, along with the examples
included with the package, and once it's working PyCurl does an
outstanding job.

You might take a look at Beautiful Soup for parsing the HTML once PyCurl
has fetched it for you:

http://www.crummy.com/software/BeautifulSoup/

Also, no matter what method you finally end up with, you'll undoubtedly
need to mangle long filenames into 8.3 names, at least for attachments
and the like.

Regards,
Cliff

--

Aug 1 '06 #2
"John Savage" <ro*******@subu rbian.com.auwro te in message
news:06******** *************** ********@suburb ian.com...
I have a free web mail address and would like to use python to retrieve
files that have been emailed to me. The basic code would accommodate
cookies, a login name and password, then download using the full URL I
can provide. From postings here I thought mechanize held promise, but
I've found it to contain filenames that are invalid for MSDOS (too many
characters, and/or too many dots in the name, etc.) so I have little hope
that the mechanize module can be used.

I'm running python2.4.2 on plain MSDOS (not windows), so would appreciate
a pointer to sample code that can do the job. I know that curl has this
capability, but I'll learn something by tinkering with python code.

Thanks.
--
John Savage (my news address is not valid for email)
Instead of mimicking a browser to access this e-mail account through the web
interface, see if there is a POP3 access to your free e-mail (I'd be
surprised if there isn't). POP3 programming (using the supplied poplib
module) is *very* simple in Python, handles login name and pwd, no
cookie-ing required. The Python docs include this example:
http://docs.python.org/lib/pop3-example.html

-- Paul
Aug 1 '06 #3

"Paul McGuire" <pt***@austin.r r._bogus_.comwr ote in message
news:Bg******** ***********@tor nado.texas.rr.c om...
Instead of mimicking a browser to access this e-mail account through the
web
interface, see if there is a POP3 access to your free e-mail (I'd be
surprised if there isn't).
To the contrary: Yahoo, for instance, charges for POP3 access; for 'free'
browser access, you 'pay' by exposure to ads. I imagine others do the
same. And yes, paying $20/year for the POP3 access should be worth it to
most people.

tjr

Aug 1 '06 #4
On 2006-08-01 13:41:47, Terry Reedy wrote:
>Instead of mimicking a browser to access this e-mail account through the
web interface, see if there is a POP3 access to your free e-mail (I'd
be surprised if there isn't).

To the contrary: Yahoo, for instance, charges for POP3 access; for 'free'
browser access, you 'pay' by exposure to ads. I imagine others do the
same.
Not all. E.g. Google allows (free) POP3 access to the free Gmail accounts.
If you don't want to change your e.g. Yahoo email address, you may be able
to set up an auto-forwarder on Yahoo and retrieve from Gmail.

Gerhard

Aug 1 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3629
by: Le | last post by:
So here's my dilemma. I need an automated SQL Server (2000) job that runs once once per hour. This jobs should: 1) Retrieve unread email for the user "Le" from our Exchange Server, and insert it into a table. 2) Retrieve unread email for the user "Smith", from from our Exchange Server, and insert it into a table.
0
1830
by: John Dalberg | last post by:
Mail component to retrieve mail from Hotmail, Yahoo, gmail..etc? I am not sure these web based mail support POP3 or IMAP4. Is there any mail component out there that can retrieve mail from these services? -- John Dalberg
1
2265
by: John | last post by:
Hi First of all apologies for posting so much code but this is rather involved and I am totally stumped. Basically I have a main form (Staff Batch SMS/E-Mail) which calls a function (SendSMS) in a module with in turn calls a form (frmInet) which contains an ms internet control (Inet1). Problem is that once the function Send SMS returns and the code tries to close the main form a 'Runtime error 2486: You can't carry out this action at...
1
2980
by: Barney Nicholls | last post by:
Is it possible to retrieve the headers only from a pop3 mail server. I can currently retrive the message id and size but would like more information ideally the following: Subject From To
5
18956
by: ad | last post by:
I have define some appsetings in ap.config like: <configuration> <appSettings> <add key="MailBody" value="Test Mail body"/> </appSettings> ..... I use
1
1360
by: Sospeter | last post by:
Hi, I want to connect to a mail store from an ASP.NET application. Once I connect to the mail store I want to be able to retrieve a message from a particular user. The problem I have is I don't know how to connect to exchange. Thought it would be as easy as connecting to a sqlserver but that doesn't seem to be the case. Any ideas please. Cheers, Sos
13
2201
by: no.mail.pls | last post by:
Hiya, How do i retreive fields with similar values from 2 tables? I tried to use (1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like '%p.name%'"; but it retrieves nothing at all. (2) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like p.name";
0
990
by: avinashibs | last post by:
how to retrieve a mail using pop3 in vb.net ? i have done the authentication , but i can't retrieve a mail ????? plz help me out regarding this matter.....................
6
1310
by: =?Utf-8?B?UGF1bA==?= | last post by:
Could anyone point me to articles, examples or a brief explanation as to which .Net objects I would use if I wanted to retrieve e-mail programmatically from an e-mail server? TIA.
0
9020
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8861
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9616
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8282
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6830
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4726
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4910
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3340
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2237
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.