Product
Aspose.Email for Java with Exchange Web Services (EWS)
Question
How can I retrieve the original sender’s timezone from emails fetched from Exchange using Aspose.Email? All timestamp properties and headers are returning UTC (+0000) instead of the sender’s local timezone.
Scenario
- Users send emails from Outlook Desktop Application (Windows)
- Users are in different timezones (e.g., IST +0530, PST -0800)
- Fetching emails via EWS using IEWSClient
- Need to display timestamps in sender’s original timezone
Code and Results
Fetching Email
IEWSClient client = EWSClient.getEWSClient(ewsUrl, username, password);
MapiMessage mapiMessage = client.fetchMessage(messageId);
Attempt 1: MapiMessage Standard Methods
Date deliveryTime = mapiMessage.getDeliveryTime();
Date clientSubmitTime = mapiMessage.getClientSubmitTime();
Date creationDate = mapiMessage.getCreationDate();
System.out.println(clientSubmitTime);
// Output: Thu Oct 30 15:28:10 UTC 2025 (UTC, not sender's timezone)
Attempt 2: MAPI Properties via getProperties()
MapiPropertyCollection properties = mapiMessage.getProperties();
// PR_MESSAGE_DELIVERY_TIME
MapiProperty deliveryTimeProp = properties.get_Item(0x0E060040L);
Date time = (Date) deliveryTimeProp.getData();
System.out.println(time);
// Output: 30-10-2025 22:28:11 (UTC)
Attempt 3: Timezone-Specific MAPI Properties
// PR_SENDER_TIME_ZONE
MapiProperty senderTz = properties.get_Item(0x0E09001FL);
System.out.println(senderTz);
// Output: null
// PidLidTimeZoneDescription
MapiProperty tzDesc = properties.get_Item(0x8234001FL);
System.out.println(tzDesc);
// Output: null
// PidLidTimeZoneStruct
MapiProperty tzStruct = properties.get_Item(0x82330102L);
System.out.println(tzStruct);
// Output: null
Attempt 4: Email Headers
String dateHeader = mapiMessage.getHeaders().get("Date");
System.out.println(dateHeader);
// Output: Thu, 30 Oct 2025 15:28:10 +0000 (UTC, not +0530)
Attempt 5: Transport Message Headers
String transportHeaders = mapiMessage.getTransportMessageHeaders();
System.out.println(transportHeaders);
// Shows all Received headers with +0000 (UTC)
Attempt 6: MailMessage Class
MailMessage mailMessage = mapiMessage.toMailMessage(new MailConversionOptions());
Date date = mailMessage.getDate();
System.out.println(date);
// Output: Thu Oct 30 17:45:45 UTC 2025
String dateHeader = mailMessage.getHeaders().get_Item("Date");
System.out.println(dateHeader);
// Output: Thu, 30 Oct 2025 17:45:45 +0000
Attempt 7: Searching All Properties
for (MapiProperty prop : properties) {
String name = prop.getName();
if (name != null &&
(name.toLowerCase().contains("time") ||
name.toLowerCase().contains("zone") ||
name.toLowerCase().contains("tz"))) {
System.out.println(prop.getName() + ": " + prop.getData());
}
}
// Output: (No properties found with timezone information)
Attempt 8: Named Properties
MapiNamedPropertyMappingStorage namedProps = mapiMessage.getNamedProperties();
if (namedProps != null) {
System.out.println("Count: " + namedProps.getCount());
// No timezone-related named properties found
}
Properties Checked (All NULL or UTC)
| Property Tag | Property Name | Result |
|---|---|---|
| 0x0E060040 | PR_MESSAGE_DELIVERY_TIME | UTC Date |
| 0x00390040 | PR_CLIENT_SUBMIT_TIME | UTC Date |
| 0x30070040 | PR_CREATION_TIME | UTC Date |
| 0x0E09001F | PR_SENDER_TIME_ZONE | NULL |
| 0x8234001F | PidLidTimeZoneDescription | NULL |
| 0x82330102 | PidLidTimeZoneStruct | NULL |
| 0x8257 | PidLidAppointmentTimeZoneDefinitionRecur | NULL |
| 0x3FF10003 | PR_MESSAGE_LOCALE_ID | NULL |
Actual Email Headers
Date: Thu, 30 Oct 2025 15:28:10 +0000
Received: from PNZPR01MB8313.INDPRD01.PROD.OUTLOOK.COM ... Thu, 30 Oct 2025 15:28:10 +0000
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2025 17:45:45.3263 (UTC)
All headers show UTC (+0000), not sender’s timezone (+0530).
Questions for Aspose Team
-
Is there an Aspose.Email method or property we’re missing that can extract sender’s timezone?
-
Does Aspose.Email provide any API to:
- Access timezone information from TNEF data?
- Parse timezone from Exchange-specific properties?
- Retrieve sender’s mailbox timezone settings?
-
Are there any extended MAPI properties that Aspose.Email can access that might contain timezone data?
-
Is this a limitation of:
- How Outlook sends emails (normalizes to UTC)?
- Exchange Server (strips timezone)?
- Or something Aspose.Email can work around?
-
What is Aspose’s recommendation for scenarios where we need to track sender’s original timezone?
Environment Details
- Aspose.Email for Java: [Version - please check your version]
- Exchange Server: Office 365 / Exchange Online
- Email Client: Microsoft Outlook Desktop (Windows)
- Sender Timezone: IST (UTC+05:30)
- Sender Location: India
Expected vs Actual
Expected Behavior:
- Email sent at 8:58 PM IST
- Date header:
Thu, 30 Oct 2025 20:58:00 +0530
Actual Behavior:
- Date header:
Thu, 30 Oct 2025 15:28:10 +0000 - All Aspose methods return UTC time
Use Case
Building an email processing application that:
- Fetches emails from shared mailbox via EWS
- Needs to display timestamps in sender’s original timezone
- Needs to track when emails were sent (in sender’s local business hours)
Request
- Is there any native Aspose.Email way to retrieve timezone?
- Are we missing any methods, properties, or features?
- Any guidance would be greatly appreciated!
Thank you for your help!