472,954 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

Re: [Fwd: Re: How to make one program connect to more than one TCP?]

ag**@cs.its.ac.id wrote:
i want to make one program that the steps like this:
1. download email from email account, for example: ag**@yahoo.com, saved
in a file, for example: downloadedEmail.txt
Can be done via the standard imaplib module. No need to use twisted.
2. parsing the downloadedEmail.txt, get the sender, subject and the
message.if there is attachmet/s, not be taken.
Save it as an eml file. Use the standard email.Parser module for
extracting headers.
3. posting the downloadedEmail.txt that has been parsed into nntp server.
4. open nntp client for example 'thunderbird' to acces your nntp server.
I have no clue about it.
i attach my programs to u..
it is very important for me as final project in my study class, too
difficult for me....thanks for your help!!!
Well, I can send you some examples that show how to download and parse
emails from imap server. I have never used nntp before so....
Some examples are attached, and also a code fragment:

IMAPDate.py - to convert between IMAP and datetime.date
imaputils.py - to show how to connect to IMAP server and list folders on
it (you need to create your own local.py file...), also shows how to
append a new message to a folder on the imap server.
code_fragment.py - to show how to search for messages on the server and
download them as pure data string, it is NOT a complete program!

And finally, here is how you parse and email:

import email.Parser
email_data = file('test2.eml','rb').read()
parser = email.Parser.Parser()

Then you need to example "parser" and its methods.

Anyway, it is your homework, I don't think that I'm going to give more
help unless you have a specific question. :-)

Best,

Laszlo

Jun 27 '08 #1
0 913

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

Similar topics

8
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
17
by: los | last post by:
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to...
3
by: Pat Deegan | last post by:
Greetings, I've been having issues while debugging programs. The problems only appear when using the '-d' switch and I get the impression it has to do with UTF8 and regex matching but I don't...
2
by: Indy | last post by:
Greetings. I am writing an asynchronous server, and I use the standard library's module asyncore. I subclass asyncore.dispatcher. handle_accept works just right, that is, when a client socket...
0
by: 2Barter.net | last post by:
Fwd: A Blessing found for Daytona Beach Florida Hello This is Craig Oral Somerford and I've been using Gmail and thought you might like to try it out. Here's an invitation to create an...
22
Frinavale
by: Frinavale | last post by:
How To Use A Database In Your Program Many .NET solutions are database driven and so many of us often wonder how to access the database. To help you understand the answer to this question I've...
7
by: TerpZebra | last post by:
I am having difficulty connecting to SQL Server 2000 on one of our servers via a VB6 program on Vista. I can connect fine to a different server, but it gives me the following error with the server...
1
by: jake77.lucas | last post by:
I'm using 2005.Net C++ compiler. I have a base class in namespace A (call it Class1). I derive another class from it, (call it Class2) defined in namespace B. This derived class contains as a...
0
by: Laszlo Nagy | last post by:
agus@cs.its.ac.id wrote: Create more sockets, connect to the server multiple times. Why do you want to do this? What is your problem that makes you think you need to open more connections at the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

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.