private static void HandleSubjectAndBody(SafeMailItemClass mailItem, UniversalRequestObject uro) { string subject = (string)mailItem.get_Fields(0x0037001E); if (null == subject) subject = String.Empty; uro.Properties.Add(MailMessagePropertyKeys.Subject, subject); Logging.Trace.WriteLine(uro.Properties[MailMessagePropertyKeys.Subject], "RedemptionMailConverter.Convert"); string msgBody = null; msgBody = mailItem.Body; if (mailItem.Body == null) msgBody = String.Empty; else msgBody = mailItem.Body; uro.Properties.Add(MailMessagePropertyKeys.Body, msgBody); }
private static DateTime GetDate(SafeMailItemClass mailItem) { object oDate = mailItem.get_Fields(0x0E060040); if (oDate != null) { try { DateTime dt = (DateTime)oDate; return dt; } catch (InvalidCastException) { Logging.Trace.WriteLine("An invalid date was returned from MAPI field. On screen the date for this item will default to Now", "RedemptionMailConverter.HandleSendDate"); } } return DateTime.Now; }