473,785 Members | 2,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p y - 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.Pa rser()

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 952

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

Similar topics

8
6629
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
17
4008
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 sleep for 1 second after indexing a couple of files. I'm wondering if anyone knows of a way that I could make so that the program will run at full speed only runs after the computer has been idle for a while. I've looked at the "nice" command...
3
2441
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 know how to deal with it. One particular example is a program which uses the DBI to connect to a database, which will run fine normally but will hang during the call to DBI->connect() when running under the debugger.
2
2071
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 makes a request to connect to my server socket, things that I set in handle_accept definition, happen. So, it is OK. But, the problem is that handle_read does not work as expected. Things I set in handle_read definition, do not happen when a client...
0
1889
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 account.Thanks for your message: Elroy's little buddie is looking for you. Craig there is a few of them as well On "CLICK" to start #1 of #2 http://www.youtube.com/watch?v=ZnzNqOT7eN4 From: answers-editors@google.com <answers-editors@google.com> Date:...
22
60289
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 provided the following as a quick example of how to retrieve data from a database. In order to connect to a SQL Server Database using .NET you will need to import the System.Data.SqlClient package into your program. If you are not connecting to a...
7
6565
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 in question: "Unable to connect to database. Please check your internet connection Error# -2147467259 SQL Server does not exist or access denied"
1
1873
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 member datum a pointer to an object of type Class3 from namespace A, and thus requires forward declaration. I attempted the following in the Class 2 hpp file: #include "Class1.hpp" // << Base class "A::Class1" - need this of course.
0
742
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 same time? Do you have a small example program to post? Laszlo
0
9645
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
10329
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
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7500
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
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
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.