Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read emails and attachments 1

Status
Not open for further replies.

RBSTR

Programmer
Nov 10, 2005
71
GB
Hi

I want to develop an application that will:
- Monitor emails incoming to a specific mailbox on an Exchange Server
- Read the email subject
- Save the attachment on the email
- Move the email to another folder.

I have googled and seem to come up with various options along the lines of:
- 'Exchange sinks'
- 'Exchange journaling'
- 'CDOEX'
- 'Webdav'
For such a (I think) simple task such various methods have confused me.
What recommendations can anyone make?
This is the first project I have done that would read Exchange server. What things may I need to consider? The machine it will run on may not be the Exchange server itself and may not have an email client like Outlook installed on it.
Many thanks in advance.

 
I have researched further and believe I can use CDO and Extended MAPI API also to read emails and attachments. I am little more familiar with these.
What I am not clear on is whether either of these require Outlook to be installed.
The client my application will be installed in may not have Outlook installed and would would need to logon to a mailbox.
Can anyone offer up any advice?
Many thanks
 
>may not have Outlook installed and would would need to logon to a mailbox.

So you'd need to

a) download CDO 1.2.1
b) Create (at least one) a MAPI profile
c) Install MAPI subsystem

Sadly, one of the few ways to get a MAPI subsytem installed is to ... install Outlook ...

However :), this may help, including both CDO and MAPI (in addition the version of CDO 1.2.1 it includes is the one without the security dialogs - at least it used to be, making it ideal for automation)
 
Thanks for these tips.

So what does profman2.exe exactly do? Will it add all the necessary files and entires on a computer required for the MAPI client to send/receive emails? Will it need username & password of the email account that I want it to use?
 
>Will it add all the necessary files and entires on a computer required for the MAPI client to send/receive emails

No, the MAPI syubsystem included in the download in the final link I provided does (most of) that.

However ...

VB can't talk directly to MAPI, so it needs a library. CDO is that library, providing VB with a COM interface to the MAPI subsystem. The MAPI subsystem isn't normally installed on machines without Outlook (or Exchange Server), so we need to download and install a standalone version. And this MAPI subsytem doesn't know what it is supposed to be talking to without a MAPI profile (more commonly known as an Outlook Profile) - and Outlook is one of the few ways we can create a profile from scrratch. So we need to download a tool that can create a profile for us - and ProfMan2 can do just that (amongst other things)

>Will it need username & password of the email account

Once you've installed MAPI and CDO and created a profile ... yes.
 
Thank you for the clarification. Hopefully I'll get everything running soon.
 
Hello,

Within my script (using MAPI.Session object), I have to send a message. I am able to compose it and finally do newMessage.Send(). I do that on a computer with Oultook installed and closed. I give it a minute or two, open Outlook, and see that the message is still in the Outbox folder.

Is the reason why the message is not being sent automatically is that im using Outlook and not the CDO package?

Thank you in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top