I create an application that gets email from mail server. I use "System.Net.Mail.MailMessage" for receive email. Now I want to get "Date and Time" of each email that ins in Inbox.
Open the message you want to see the date for. Below the sender's name and next to the recipient's (usually, to: me) tap the down arrow to show more details. These details include the sender's email address, your email address, and the full date the message was sent.
Click on the View tab. Then click View Settings. From the Format drop-down menu (click the down arrow to the right of the format field), then select how you want it displayed.
To find emails from after a specific date, use After:YYYY/MM/DD. So for example, if you're trying to find emails from before or after September 1st, 2021, type either Before:2021/09/01 or After:2021/09/01 into the search bar and hit Enter. You can combine both keywords to find emails between two dates.
The easiest way to insert the timestamp or the current date and time is hot keys. To insert current date in your email messages, please press the Alt + Shift + D keys at the same time. To insert current time in your email messages, please press the Alt + Shift + T keys at the same time.
You will want to look at the emails headers here is some documentation
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.headers.aspx
message.Headers["Date"];
I inspected the MailMessageObject and found this:
Headers=HeaderCollection(5)
{
"Uid",
"DateCreated",
"DateReceived",
"Date",
"IsRead"
So that means you have a total of three options available to you. The output will be in string format.
message.Headers["DateCreated"];
message.Headers["DateReceived"];
message.Headers["Date"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With