473,769 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading mails from Outlook

Hi,

Does anyone knows how to read e-mails from a specific folders in
outlook?
I only found out how to read the mails from the inbox folder and how
to list all available folder.
I just don't found a way to access my mails from the other folders.

Can anyone help me?

Regards,

Sam

Feb 22 '07 #1
2 6203
beeswax wrote:
Hi,

Does anyone knows how to read e-mails from a specific folders in
outlook?
I only found out how to read the mails from the inbox folder and how
to list all available folder.
I just don't found a way to access my mails from the other folders.

Can anyone help me?

Regards,

Sam
I'll bet that some of the best information you can get about interacting
with Outlook is going to be by looking at the sourcecode to SpamBayes
plug-in. You can get it from here:

https://sourceforge.net/project/show...ckage_id=58141

-Larry
Feb 22 '07 #2
On 22 feb, 15:45, Larry Bates <lba...@websafe .comwrote:
beeswax wrote:
Hi,
Does anyone knows how to read e-mails from a specific folders in
outlook?
I only found out how to read the mails from the inbox folder and how
to list all available folder.
I just don't found a way to access my mails from the other folders.
Can anyone help me?
Regards,
Sam

I'll bet that some of the best information you can get about interacting
with Outlook is going to be by looking at the sourcecode to SpamBayes
plug-in. You can get it from here:

https://sourceforge.net/project/show...61702&package_...

-Larry
Hi again,

I found the solution myself, the next code will iterate all folders,
sub folders and their mails.
I just needed to understand what I could do with the folders objects.
But, this code will trow an error when trying to connect to shared
folders (exchange folders etc).

Btw does anyone knows a good API for this, or a way to get all the
properties from an object?
# Create instance of Outlook
o = win32com.client .gencache.Ensur eDispatch("Outl ook.Application ")
# Dump all folders recursive, starting from root
DumpFoldersRecu rsive(o.GetName space("MAPI").F olders,0)
o = None

def DumpFoldersRecu rsive(folders,i ndent):
# Note: the com indexes start from 1
for i in range(1,folders .Count+1):
folder = folders[i]
print '%sFolder %d: "%s"' %
('\t'*indent,i, DecodeUnicodeSt ring(folder.Nam e))

# if a folder has no subfolders, its Folders.Count will be
zero, so this is safe.
for i in range(len(folde r.Items)):
message = folder.Items[i+1]
print message.Subject

DumpFoldersRecu rsive(folder.Fo lders,indent+1)

Regards,

Sam

Feb 23 '07 #3

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

Similar topics

0
1042
by: Nishchal | last post by:
Hello, I am trying to read the email messages for different profiles and I want to do this without user's intervention. I am the administrator and I have the rights and passwords but when I switch user it prompts me a dialog box to confirm the user name and password even though I am providing the profile and the password. Actually I have to send these messages and there attachments to the printer and all this is supposed to be done...
1
1378
by: Richard | last post by:
Hi Friends, How can I read and delete outlook e-mails from vb.net. I'll appreciate your help. RC
0
1795
by: Karen Grube | last post by:
Hi! I hate to bother you all with this, but I don't know how best to approach a particular task. Here's the deal: Once a month I personally (that is, in my own personal inbox on my company's email server) receive an email from one of our vendors to which is attached a text file (a comma-delimited data file containing the details of our monthly
2
1478
by: GSK | last post by:
Hi, Can any once suggest me how i can read inbox mails from C#. Does .NET support any component or do i need to use the Mapi interop. Thanks... GSK.
0
1318
by: teddy06 | last post by:
I have written code for read mails from exchange server. I have used webdav in my code. Its was working fine once upon a time. Currently configuration settings of client has been changed . so i am getting login timeout error. Can you pls help me out ? I dont know whether the WEBDAV is enabled or disabled.even i do not have access to enable it and see the configuration settings. pls provide some sample code for reading mails from...
2
2655
by: mesho | last post by:
Hi Forum Members, I am trying to write a program that read the outlook files "pst" and classify the emails in a user defined folders (In MS Outlook). I dont know where and how to start. So is there any body that can give me a start point or give me the code? I would like to do this in visual basic or C++.
4
2837
by: venutaurus539 | last post by:
Hello, I was getting an error in Cocreate instance while trying to access "Outlook" using python script. The python script looks like: from win32com.client import Dispatch session = Dispatch("MAPI.session") session.Logon('OUTLOOK') # MAPI profile name inbox = session.Inbox When I tried to execute the script I got the error:
1
1111
by: AcidAndroid | last post by:
This question is in regards to this article. Hi, you code works fine , but i have a trouble reading the mails talking about "undelivery mail" you know when you get a mail when you send a mail to a wrong address. When the loop try to read the system manager message (mail) it always get an exception talking about a Unable to cast a COM object 'System.__ComObject' to the inteface 'Microsoft.Office.Interop.Outlook.MailItem'. I guess...
2
1314
Maidenz08
by: Maidenz08 | last post by:
Can you please shed some light on how to capture incoming and outgoing mails from third party mail providers like yahoomail and gmail on a particular machine. I am able to read mails sent or recieved from outlook but what is the methodology that can be used to capture mails through other mail providers. Thanks in advance
0
9589
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
10215
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
10049
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...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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
7410
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3564
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.