Re: How to identify mail for specific user

From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 08/12/04


Date: Thu, 12 Aug 2004 19:57:37 -0400

The Recipients collection will tell you who the message was sent to, unless
the recipient got it as a Bcc.

As for the sender, you can use SenderName. If you need the address, too, in
Outlook 2003, you can use the MailItem.SenderEmailAddress, but note that
it's subject to security prompts in certain contexts.

In earlier versions, there is no Outlook property that returns the sender's
email address. You can either use CDO (or Redemption to avoid security
prompts -- http://www.dimastr.com/redemption/) to get the From address or
use Outlook to get the Reply To address. Sample code at
http://www.outlookcode.com/d/code/getsenderaddy.htm

To get the SMTP address from an Exchange sender or recipient, use CDO or
Redemption and the PR_EMAIL (&H39FE001E) MAPI property to obtain the SMTP
address from the AddressEntry object. See
http://www.outlookcode.com/d/code/getsenderaddy.htm#redemption and
http://www.cdolive.com/cdo5.htm#EMailAddressOfSender for examples.

It is not appropriate to run Outlook automation code on a server or as a
scheduled task, because of the likelihood that Outlook will display modal UI
that will halt the application.

-- 
Sue Mosher, Outlook MVP
Author of
     Microsoft Outlook Programming - Jumpstart for
     Administrators, Power Users, and Developers
     http://www.outlookcode.com/jumpstart.aspx
"MikeC" <anonymous@discussions.microsoft.com> wrote in message
news:47fa01c47fe5$3b792550$a401280a@phx.gbl...
> Can anyone tell me if there is a way, using VBA, to
> identify messages sent to a specific Outlook user from a
> specific sender?  Ultimately, I will include code that
> will save,  to a network folder, specifically named file
> attachments that arrive with these messages.
>
> An additional objective is to automatically run this code
> in background not using an Outlook client...or at least
> not require the above recipient to launch Outlook in order
> to run this code.  I had been considering either running a
> scheduled task or possibly finding a way to run this code
> from the mail server.  Any thoughts?


Relevant Pages

  • Re: Security flaw in how Outlook verifies digital signatures
    ... That is exactly what Outlook is *not* doing... ... simple verification that the sender is actually who he says he is. ... sender gives to a recipient so that the recipient can verify the ... > clearly states that digital signatures are also used to verify the sender. ...
    (microsoft.public.outlook)
  • Re: not receiving PDF files
    ... You are the Outlook sender as well as the recipient with the problem? ...
    (microsoft.public.windows.vista.mail)
  • Re: suffix .dat
    ... The only .dat files I've seen are winmail.dat attachments in email. ... These are sent from Outlook Windows whenever the sender sends mail in RTF ...
    (microsoft.public.mac.office.word)
  • Re: suffix .dat
    ... The only .dat files I've seen are winmail.dat attachments in email. ... These are sent from Outlook Windows whenever the sender sends mail in RTF ...
    (microsoft.public.word.docmanagement)
  • RE: Issue with returnable form
    ... Sub btnReturn_click ... Author of Microsoft Outlook 2007 Programming: ... is it the read view that is viewable to the original sender? ...
    (microsoft.public.outlook.program_forms)