0

I have a program that uses EWS to pull emails from an exchange server, gets the attachments off of them and converts them to PDFs. Before I convert them, I check all of the extensions of the attachments to make sure they are something I can handle.

My problem is when an email (msg) is the attachment in an email. In outlook/exchange, these do not show the extension, so any way I try to pull the extension, I get nothing or something incorrect like .itemattachment.

user2615372
  • 3
  • 2
  • 7

2 Answers2

0

Is it an actual MSG file or an embedded message attachment? In the latter case there is no extension, or even a file name for that matter.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
0

I was able to solve this problem by loading the item attachment and the pulling the data from it. I put the data in html format then convert that to pdf. I just do a check first to see if the type of attachment is file or item

user2615372
  • 3
  • 2
  • 7