Scanning all incoming e-mails

A

Al_21_11

Hi

scan all new incoming e-mails and post archiving email by posting to DB. i
have the second part down. I will be calling a class that will handle posting
record to DB, but need to know how can i get all incoming e-mails.

Thanks
 
A

Al_21_11

HI Ken,
Thanks that works. Is there a way of running this same routine when users
use outlook web access?
 
K

Ken Slovak - [MVP - Outlook]

No. OWA runs on an IIS server and is javascript code that directly accesses
the Exchange mailbox. It has nothing to do with Outlook or Outlook code. For
something to work with OWA you would need server side code that runs as an
Exchange event sink on the mailbox folders you're interested in. If you go
that route you wouldn't use the Outlook code at all since that would run
similar code twice.
 
A

Al_21_11

HI
ken
would the same routine work if outlook has several different e-mails
accounts. is there a way i can specify which e-mails account to scan incoming
e-mails from?

thanks
al
 
K

Ken Slovak - [MVP - Outlook]

You can use the MailItem.SenderEmailAddress property to see what email
address sent an email and you can use To for who it was sent to. However, To
usually is just a name like "Ken Slovak" and not an email address. For that
you'd need to get each item's Recipients collection and get each Recipient
object. There may be more than one of course.
 
A

Al_21_11

Hi Ken,
Would this work.

If i use the Application.NewMailEx() to get all incoming e-mails, and then
use a filter to for the "TO" field and filter e-mails from inboxes that i do
not need?

hope im making sense.

thanks
Again
Al
 
K

Ken Slovak - [MVP - Outlook]

Any Outlook profile can only have one delivery point (Inbox), so items going
to other stores won't fire that event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top