Consulting

Results 1 to 8 of 8

Thread: Solved: The sent date / time of an email

  1. #1

    Solved: The sent date / time of an email

    Hello dear outlook vba'rs,

    For us it very interresting to find out the real sent date/time of an email.

    For example a mail is sent in Australia and received in the mail provider in Australia at: 1 July 2005 at 07:30 and received at our office at: 2 July 2005 at 15:14.

    Can we get the sent date/time from the mail when he was received in the Australia mail provider?? (1 July 2005 at 07:30)

    If yes, can someone show the source.

    The receiving date/time in our office we don't want to know.

    Nice regards,

    Michelle.

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    First off, I should point out I'm no Exchange Server guru, but here's how I understand the process...

    All this info is held as MAPI properties (such as PR_CLIENT_SUBMIT_TIME) and only some of those are transposed into the equivalent mail item properties. I'm not sure when the date localisation occurs or whether the original MAPI properties are updated or left as original but either way you would need some implementation of the MAPI SDK like Redemption or Outlook Spy to access these.
    K :-)

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Michelle,

    The equivalent of "PR_CLIENT_SUBMIT_TIME" Killian spoke of in VBA of the mailitem object would be: ".SentOn"

    Like: oMailItem.SentOn

    But I also don't now how to retrieve all the data of servers where a mailitem has been since it was Send!

    At our company a single mailitem is routed to 6 different Internal Servers (World wide) because of policy and you can trace that if you mark it for trace.

    That data is probably what your looking for but I've got no clue where to get that data. The Redemption tip of Killian will probably work because Redemption exposes so much more then you can accomplish in VBA.

    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  4. #4
    Dear Killian and Mos Master,



    It don't interrest us over how many servers a mail is sent, the only thing what important is, that is the first time a mail is received by a server.


    Is there a posibillity to get this date/time?

    The MM is talking about: oMailItem.SentOn, what is that for a date/time? How can we get this?

    Nice regards & thanks for the help

    Michelle.

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Michelle,

    If it's your server then use the ".ReceivedTime" property of the mailitem object. That's the time on which you received it. Just try it out.

    You ask me how to get the ".SentOn" property of the mailitem object. That's kinda strange to me. You've been programming for a longer time now in Outlook.

    Haven't you worked on email items (MailItem) before in Outlook?

    The MailItem object has to many properties to start explaining but
    this code will give you some:[VBA]
    Sub GetMailProps()
    Dim myMail As Outlook.MailItem
    For Each myMail In Application.ActiveExplorer.Selection
    MsgBox "Mail was sent on: " & myMail.SentOn & vbCr & _
    "by: " & myMail.SenderName & vbCr & _
    "message was received at: " & myMail.ReceivedTime
    Next

    Set myMail = Nothing
    End Sub
    [/VBA]
    Just select some Mailitems in your Inbox and run the sub.

    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  6. #6
    Hello Mos Master,

    Thanks for the information, you are great!

    Michelle.

  7. #7
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by michelle
    Hello Mos Master,

    Thanks for the information, you are great!

    Michelle.
    You're most welcome..tnx to Killian as well!

    Ps..don't forget to mark the thread.
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  8. #8
    Quote Originally Posted by MOS MASTER View Post
    Hi Michelle,

    If it's your server then use the ".ReceivedTime" property of the mailitem object. That's the time on which you received it. Just try it out.

    You ask me how to get the ".SentOn" property of the mailitem object. That's kinda strange to me. You've been programming for a longer time now in Outlook.

    Haven't you worked on email items (MailItem) before in Outlook?

    The MailItem object has to many properties to start explaining but
    this code will give you some:[VBA]
    Sub GetMailProps()
    Dim myMail As Outlook.MailItem
    For Each myMail In Application.ActiveExplorer.Selection
    MsgBox "Mail was sent on: " & myMail.SentOn & vbCr & _
    "by: " & myMail.SenderName & vbCr & _
    "message was received at: " & myMail.ReceivedTime
    Next

    Set myMail = Nothing
    End Sub
    [/VBA]
    Just select some Mailitems in your Inbox and run the sub.

    Enjoy!
    Thank you after 18yrs!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •