Editing EML files

We have an API where we save eml files to Group Mailbox (O365 unified group).
We need to add extra header information to the eml file before saving these files to Group mail.
Can we use Aspose.Email for this purpose?

Thanks

@rezamatin

Can you please explain the requirements on your end in detail and also with snapshot that which header information you are interested in to have. We will investigate that on the basis of that to help you further.

We have an API where we import EML files from User Exchange MailBox to Group MailBox
These ELM files are of the Stream type.

For outgping mail we would like to add value in the EML header “X-Msg2Mime-Client-Submit-Time”. Before we save the elm file to Group Mailbox

@rezamatin

Yes, they can add extra header in MailMessages before them will be appended by EWS client to O365 mailbox. You may use IMAP client.

  MailMessage message = new MailMessage(
                        user.EMail,
                        user.EMail,
                        "Subject " + Guid.NewGuid().ToString(),
                        "body");
                    message.Headers.Set("NewHeader", "HeaderValue");
                    string uri1 = client.AppendMessage(mbInfo.InboxUri, message);

Thanks, I can see my outgoing EML missing “PR_CLIENT_SUBMIT_TIME” and because of that, mails getting wrong datetime.

Is there any way to add “PR_CLIENT_SUBMIT_TIME” to header?

MailMessage mails = MailMessage.Load(mailStream);

@rezamatin

I suggest you to please visit the following thread links for usability of PR_CLIENT_SUBMIT_TIME.

Hi

I’m using load from Stream for getting EML-stream. In this case I can’t see the SetProperty method for mailmessage.

MailMessage mails = MailMessage.Load(emlStream);

@rezamatin

These are MapiMessage properties and not MailMessage. Can you please consider using MapiMessage instead of MailMessage.