Hello there,
I am creating PST file using mail properties. I am assigning properties of mails to Aspose MailMessage object properties.I want to add some more properties to mail.
sent: -date and time of mail sent
received:-date and time of mail received
created:-date and time of mail created
SenderAddressType:-here i have seen like “SMTP”
MessageSize:-int e.g :-3901278
LastModificationTime:date and time of mail
TransportMessageHeader:-e.g"From:“Brian Peter<[Brian.Peter@ClarkContacts.com](mailto:Brian.Peter@ClarkContacts.com)
”
InternetMessageId:-[495DCFHDGB78SGS67SADNM1D@ClarkContacts.com](mailto:495DCFHDGB78SGS67SADNM1D@ClarkContacts.com)
Apart from this can we add user defined properties.?
Please reply…soon…
Hi Pooja,
Thanks for writing to Aspose.Email support team.
You can add user defined properties by using Headers property of MailMessage. Following is a sample code which adds two user defined properties named “UserDefinedProperty1” and “UserDefinedProperty2”. Initial values are also set for these newly added properties.
Please give a try to the following code and let us know your feedback.
MailMessage mail =
new MailMessage(
"user01@gmail.com",
"user02@gmail.com", “Subject”, “Body”);
mail.Save(“Mail.eml”, MailMessageSaveType.EmlFormat);
mail.Headers.Add(“UserDefinedProperty1”, “value01”);
mail.Headers.Add(“UserDefinedProperty2”, “value02”);
mail.Save(“Mail.eml”, MailMessageSaveType.EmlFormat);
Hello Sir,
Thanx for the reply…
I have one more Question can we set the property values based on their property ids.?
Please reply…