question

JohnpCurtiss avatar image
0 Votes"
JohnpCurtiss asked JadeLiang-MSFT commented

exchange attachments different based on download method?

exchange 2016, outlook 2016. i have a mailbox, in this mailbox is a message with an attachment called "originalmessage.txt." if i open the mailbox in outlook, and right-click this attachment, and save it, i'm given the option to save it as msg or "all files". if i save it as msg OR as txt in c:\test\, both of the files are 1,762 KB, and both following powershell cmdlets work.

(New-Object -ComObject outlook.application).createItemFromTemplate("c:\test\originalmessage.txt")
(New-Object -ComObject outlook.application).createItemFromTemplate("c:\test\originalmessage.txt.msg")

i also have a non-microsoft pop3 client. if this client downloads the same originalmessage.txt file from the same mailbox, and saves it to c:\test, the file is only 1,684 KB. and if i make a copy of the file in c:\test and rename the copy with .msg on the end, both of the powershell cmdlets above fail with the following error:

Exception calling "CreateItemFromTemplate" with "1" argument(s): "We can't open 'C:\test\OriginalMessage.txt'. It's possible the file is already open, or you don't
have permission to open it.

i get a similar error when i rename the 1,684 KB version to originalmessage.txt.msg and double-click it. but i can double-click the 1,762 KB version of the ".msg" file, and it opens in outlook immediately.

so is it expected that the manual, human act of touching the attachment with outlook would make it 78 KB larger and make outlook powershell work? is there a way to get this to work outside of outlook? i have file transfer automation based on the non-Microsoft pop3 client, and the broken powershell is a real nuisance.

office-outlook-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JadeLiang-MSFT avatar image
0 Votes"
JadeLiang-MSFT answered JadeLiang-MSFT commented

Hi @JohnpCurtiss,

I noticed that you have a message with .msg attachment called "originalmessage.txt.", is it right?

If so, based on my research and test, I have tried to create a .msg file called "test.txt" locally(original size 153 KB) and send it as attachment via Outlook client, but when I saved the attachment mannually as .msg or .txt from Outlook client, the size wouldn't be changed there(still 153 KB).

So in order to further confirm your issue, what's the original size of your attachment? If it's possible, it's suggested to log into your web mail and download the attachment to check the size. If you couldn't log into your web mail, we could also try to re-create a new .msg file from Outlook, then send it as attachment and download it to check if the size has any difference.

If the size of the attachment downloaded from your web mail is same with that from Outlook client(1726 KB), or the size wouldn't be changed for your new .msg file in new test, the issue may be more related to your pop3 client itself. And based on my research, the error would be prompted when the .msg file is corrupted, so I think the attachment or your message may not be downloaded normally in your local client.

If that's not your case or you still need further assistance, please feel free to post back.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JohnpCurtiss,
Does this issue have any updates? If it has been resolved, please click "Accept as answer" to mark useful post or share your solution, your action would benefit others who have similar issues. If you have any questions or need further assistance, please feel free to post back. Thanks!

0 Votes 0 ·