PDA

View Full Version : Solved: The sent date / time of an email



michelle
07-01-2005, 04:32 AM
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. :dunno

Killian
07-01-2005, 08:44 AM
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.

MOS MASTER
07-01-2005, 10:01 AM
Hi Michelle, :yes

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! :whistle:

michelle
07-01-2005, 10:10 AM
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. :hi:

MOS MASTER
07-01-2005, 10:32 AM
Hi Michelle, :yes

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:
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

Just select some Mailitems in your Inbox and run the sub.

Enjoy! :whistle:

michelle
07-02-2005, 02:40 AM
Hello Mos Master,

Thanks for the information, you are great!

Michelle. :friends:

MOS MASTER
07-02-2005, 04:21 AM
Hello Mos Master,

Thanks for the information, you are great!

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

Ps..don't forget to mark the thread. :*)

amanphilip
07-11-2023, 12:30 AM
Hi Michelle, :yes

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:
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

Just select some Mailitems in your Inbox and run the sub.

Enjoy! :whistle:

Thank you after 18yrs!