How can I convert an Outlook MailItem object to a byte[]

Add-in Express™ Support Service
That's what is more important than anything else

How can I convert an Outlook MailItem object to a byte[]
without writing to disk 
Nevzat Hayri TAVUKÇU




Posts: 27
Joined: 2019-12-19
Currently I am using the MailItem.SaveAs(filePath) function, then using File.ReadAllBytes(filePath) to create a byte array that can be sent to the webservice.

Looking for a way to get byte[] without writing to disk
Posted 14 Jan, 2020 03:21:24 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
Hello Nevzat,

If you need the service to receive a .MSG, your only way is to use SaveAs(). If you need the service to receive some specific data from the email (such as subject, or part of the body, etc.), you can extract them in code and send them as is.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Jan, 2020 07:39:24 Top
Nevzat Hayri TAVUKÇU




Posts: 27
Joined: 2019-12-19
Thanks Andrei. We can close the topic.
Posted 15 Jan, 2020 08:42:58 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
Welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jan, 2020 09:04:11 Top