How do I get a mail item's MessageID

Discussion in 'Microsoft Outlook Program Addins' started by Guest, Feb 5, 2007.

  1. Guest

    Guest Guest

    Hi,

    I need to track messages in a database, but be able to handle the same
    message being sent to multiple recipients (within an Exchange environment).

    I know that all messages sent to multiple recipients will have the same
    MessageID value, but I can find no information as to how to retrieve it.

    What I'm planning is that when a message is opened, an AddIn will check
    whether the message has already been handled and if not, store info in a
    database (simplistic view). When another user reads the same message, I need
    to be able to detect that it's already been handled.

    Thanks for any help,

    Phil.
     
    Guest, Feb 5, 2007
    #1
    1. Advertisements

  2. I think what you want is the EntryID of the item, which is accessible from
    the Outlook object model or from other API's like CDO 1.21 or Extended MAPI.

    --
    Ken Slovak
    [MVP - Outlook]
    http://www.slovaktech.com
    Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
    Reminder Manager, Extended Reminders, Attachment Options
    http://www.slovaktech.com/products.htm


    "Bickers" <> wrote in message
    news:...
    > Hi,
    >
    > I need to track messages in a database, but be able to handle the same
    > message being sent to multiple recipients (within an Exchange
    > environment).
    >
    > I know that all messages sent to multiple recipients will have the same
    > MessageID value, but I can find no information as to how to retrieve it.
    >
    > What I'm planning is that when a message is opened, an AddIn will check
    > whether the message has already been handled and if not, store info in a
    > database (simplistic view). When another user reads the same message, I
    > need
    > to be able to detect that it's already been handled.
    >
    > Thanks for any help,
    >
    > Phil.
     
    Ken Slovak - [MVP - Outlook], Feb 6, 2007
    #2
    1. Advertisements

  3. If you mean the MIME message id header, it is not guaranteed to be present.
    If it is available, it will be in the PR_INTERNET_MESSAGE_ID property
    (0x1035001E), accessible using Extended MAPI (C++/Delphi only), CDO 1.21,
    Redemption or MailItem.PropertyAccessor in Outlook 2007

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool

    "Bickers" <> wrote in message
    news:...
    > Hi,
    >
    > I need to track messages in a database, but be able to handle the same
    > message being sent to multiple recipients (within an Exchange
    > environment).
    >
    > I know that all messages sent to multiple recipients will have the same
    > MessageID value, but I can find no information as to how to retrieve it.
    >
    > What I'm planning is that when a message is opened, an AddIn will check
    > whether the message has already been handled and if not, store info in a
    > database (simplistic view). When another user reads the same message, I
    > need
    > to be able to detect that it's already been handled.
    >
    > Thanks for any help,
    >
    > Phil.
     
    Dmitry Streblechenko, Feb 6, 2007
    #3
  4. Guest

    Guest Guest

    Hi Ken,

    I was under the impression the EntryID can change. I need the ID that was
    assigned to the message when it was sent.

    There is a MessageID in the internet headers, but will that be present in a
    message sent via Exchange ?

    Cheers,

    Phil.

    "Ken Slovak - [MVP - Outlook]" wrote:

    > I think what you want is the EntryID of the item, which is accessible from
    > the Outlook object model or from other API's like CDO 1.21 or Extended MAPI.
    >
    > --
    > Ken Slovak
    > [MVP - Outlook]
    > http://www.slovaktech.com
    > Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
    > Reminder Manager, Extended Reminders, Attachment Options
    > http://www.slovaktech.com/products.htm
    >
    >
    > "Bickers" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I need to track messages in a database, but be able to handle the same
    > > message being sent to multiple recipients (within an Exchange
    > > environment).
    > >
    > > I know that all messages sent to multiple recipients will have the same
    > > MessageID value, but I can find no information as to how to retrieve it.
    > >
    > > What I'm planning is that when a message is opened, an AddIn will check
    > > whether the message has already been handled and if not, store info in a
    > > database (simplistic view). When another user reads the same message, I
    > > need
    > > to be able to detect that it's already been handled.
    > >
    > > Thanks for any help,
    > >
    > > Phil.

    >
    >
     
    Guest, Feb 6, 2007
    #4
  5. Guest

    Guest Guest

    Thanks Dmitry.

    Is that the MessageID visible in the headers of a message ?

    What about a message sent via Exchange (ie within an organisation, without
    going out to the internet) ? Does Exchange assign an ID to sent messages ?

    Cheers,

    Phil.

    "Dmitry Streblechenko" wrote:

    > If you mean the MIME message id header, it is not guaranteed to be present.
    > If it is available, it will be in the PR_INTERNET_MESSAGE_ID property
    > (0x1035001E), accessible using Extended MAPI (C++/Delphi only), CDO 1.21,
    > Redemption or MailItem.PropertyAccessor in Outlook 2007
    >
    > Dmitry Streblechenko (MVP)
    > http://www.dimastr.com/
    > OutlookSpy - Outlook, CDO
    > and MAPI Developer Tool
    >
    > "Bickers" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I need to track messages in a database, but be able to handle the same
    > > message being sent to multiple recipients (within an Exchange
    > > environment).
    > >
    > > I know that all messages sent to multiple recipients will have the same
    > > MessageID value, but I can find no information as to how to retrieve it.
    > >
    > > What I'm planning is that when a message is opened, an AddIn will check
    > > whether the message has already been handled and if not, store info in a
    > > database (simplistic view). When another user reads the same message, I
    > > need
    > > to be able to detect that it's already been handled.
    > >
    > > Thanks for any help,
    > >
    > > Phil.

    >
    >
    >
     
    Guest, Feb 6, 2007
    #5
  6. EntryID can change if an item is moved, it depends on the store provider.
    Internet Message ID's in the headers aren't there in intra-organizational
    Exchange emails, only on emails sent via the Internet.

    --
    Ken Slovak
    [MVP - Outlook]
    http://www.slovaktech.com
    Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
    Reminder Manager, Extended Reminders, Attachment Options
    http://www.slovaktech.com/products.htm


    "Bickers" <> wrote in message
    news:...
    > Hi Ken,
    >
    > I was under the impression the EntryID can change. I need the ID that was
    > assigned to the message when it was sent.
    >
    > There is a MessageID in the internet headers, but will that be present in
    > a
    > message sent via Exchange ?
    >
    > Cheers,
    >
    > Phil.
     
    Ken Slovak - [MVP - Outlook], Feb 6, 2007
    #6
  7. AFAIK as of Exchange 2000 (or was it 2003?), the id will be set on the
    messags sent by an EX server.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool

    "Bickers" <> wrote in message
    news:...
    > Thanks Dmitry.
    >
    > Is that the MessageID visible in the headers of a message ?
    >
    > What about a message sent via Exchange (ie within an organisation, without
    > going out to the internet) ? Does Exchange assign an ID to sent messages ?
    >
    > Cheers,
    >
    > Phil.
    >
    > "Dmitry Streblechenko" wrote:
    >
    >> If you mean the MIME message id header, it is not guaranteed to be
    >> present.
    >> If it is available, it will be in the PR_INTERNET_MESSAGE_ID property
    >> (0x1035001E), accessible using Extended MAPI (C++/Delphi only), CDO 1.21,
    >> Redemption or MailItem.PropertyAccessor in Outlook 2007
    >>
    >> Dmitry Streblechenko (MVP)
    >> http://www.dimastr.com/
    >> OutlookSpy - Outlook, CDO
    >> and MAPI Developer Tool
    >>
    >> "Bickers" <> wrote in message
    >> news:...
    >> > Hi,
    >> >
    >> > I need to track messages in a database, but be able to handle the same
    >> > message being sent to multiple recipients (within an Exchange
    >> > environment).
    >> >
    >> > I know that all messages sent to multiple recipients will have the same
    >> > MessageID value, but I can find no information as to how to retrieve
    >> > it.
    >> >
    >> > What I'm planning is that when a message is opened, an AddIn will check
    >> > whether the message has already been handled and if not, store info in
    >> > a
    >> > database (simplistic view). When another user reads the same message, I
    >> > need
    >> > to be able to detect that it's already been handled.
    >> >
    >> > Thanks for any help,
    >> >
    >> > Phil.

    >>
    >>
    >>
     
    Dmitry Streblechenko, Feb 6, 2007
    #7
  8. Guest

    isobelb

    Joined:
    Apr 27, 2012
    Likes Received:
    0
    Hi
    Can someone please suggest a mapi field that truly represents the mailitem. I am sending mails using outlook 2010 and can read teh PR_INTERNET_MESSAGE_ID when I send the mail in my sent items but the recipient account records a different message_id for the mail when it arrives so why does exchange/outlook record an incorrect value. This doesn' happen when sending from say hotmail to outlook, the message id remains the same - as you'd expect.
    Is there a better field to use when trying to identify originating email for external conversations? The quote below is relevant
    Thanks
     
    isobelb, Apr 27, 2012
    #8
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Omar

    outlook mail item to MAPI store item

    Omar, Oct 8, 2003, in forum: Microsoft Outlook Program Addins
    Replies:
    2
    Views:
    1,859
    Omar Khan
    Oct 8, 2003
  2. Julia

    Will i get NewInspector event each time i display an item?

    Julia, Jan 29, 2004, in forum: Microsoft Outlook Program Addins
    Replies:
    3
    Views:
    504
    Ken Slovak - [MVP - Outlook]
    Jan 29, 2004
  3. ksskumar
    Replies:
    1
    Views:
    610
    Sue Mosher [MVP-Outlook]
    Apr 5, 2004
  4. Dattatraya Shewale

    How to get Exchange/SMTP address from 'Distinguish Name' from Outlook mail Item

    Dattatraya Shewale, Aug 3, 2004, in forum: Microsoft Outlook Program Addins
    Replies:
    7
    Views:
    1,381
    Dmitry Streblechenko \(MVP\)
    Aug 7, 2004
  5. Guest

    Get Type of Outlook item

    Guest, Apr 27, 2005, in forum: Microsoft Outlook Program Addins
    Replies:
    2
    Views:
    1,887
    Guest
    Apr 27, 2005
  6. Create mail item with mail item as attachment

    , Jun 1, 2005, in forum: Microsoft Outlook Program Addins
    Replies:
    6
    Views:
    4,085
  7. m66p1

    get item form outlook with C#.net

    m66p1, Oct 21, 2006, in forum: Microsoft Outlook Program Addins
    Replies:
    0
    Views:
    519
    m66p1
    Oct 21, 2006
  8. Next Item & Previous Item Events

    , May 6, 2009, in forum: Microsoft Outlook Program Addins
    Replies:
    1
    Views:
    610
    Michael Bauer [MVP - Outlook]
    May 7, 2009
Loading...