cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TowerDefense59
New Member

Allow .msg files as attachments to be send to FTP server

Hello,

 

I wanted to get some exposure to this topic because it appears that it has been asked before but not completely solved.  Currently, Flow doesn't consider .msg files an attachment, so they won't be work with templates such as outlook 365 or outlook.com to FTP.  Files such as pdfs do work however.

 

I hope i'm missing something or if anyone has a workaround they would like to share.  I would really appreciate it any help

 

Thank you

4 REPLIES 4
v-yamao-msft
Community Support
Community Support

Hi @TowerDefense59 ,

 

Are you trying to create attachments of type .msg attached to emails to FTP server?

 

I am afraid that it might be not possible to save .msg attachments to FTP Server. As file type of .msg in Flow is considered as no attachment included in the email, so the file cannot be extracted. Moreover, the size of the file is 0, and there is no file content can be extracted.

 

A workaround for this issue is to use Outlook.com to send email with locally saved .msg file as attachment.

 

Here is another similar thread for your reference:

https://powerusers.microsoft.com/t5/Building-Flows/Saving-email-attachments-msg-with-flow/td-p/26069...

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dougallen
Helper I
Helper I

I actually just did something similar for a client.  I evaluated Flow but it just wasn't up to the task especially given my time and budget constraints.  My client wanted to automatically comb through every email in a shared Office 365 mailbox, and save the email to a file share under certain directories that I had to create based on the date sent, To, from, etc. then delete the email.  I got it all done and it works pretty well.  I used the Exchange Web API:

 

https://www.microsoft.com/en-us/download/details.aspx?id=42951

 

Let me know if you would like more details.  

Hey @dougallen 

 

I was definitely still interested in your feedback on exchange web API.  I won't have the ability to use outlook.com like the moderator suggested.  Can you reach out to me when you have a chance?

 

Thank you

Sure, I will be happy to post some details and I apologize for the delay.  I know its not Flow related anymore, but I will try to get a sample of my script I used.  It's slightly different depending on exactly what you want to do, and I am not sure of the FTP component.  My need was that I needed to crawl every email in an Exchange Online shared mailbox, read the email header metadata, create corresponding folder structures on the local server using that metadata, and save the email message in that folder, then optionally delete the email from the shared mailbox.  I did it all with PowerShell running on the file server running as a scheduled task using the Exchange Web API.  If you are already down this path and have a specific question let me know otherwise I will get a blog written up outlining the details as quick as I can.  It also depends on what properties from Exchange you want to load.

 

Briefly, the first thing you need is to load the API:

[Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll")
$s = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService

 

Then use this to get the messages of the Inbox folder:

$ServiceAcct = "<username>"
#$mailbox = "<mailbox email address>"

 

$s.Credentials = $creds
$s.AutodiscoverUrl($ServiceAcct, {$true})
$s.ImpersonatedUserId = New-Object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress,$Mailbox )

$Propset = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.ItemSchema]::MimeContent, [Microsoft.Exchange.WebServices.Data.EmailMessageSchema]::Sender,[Microsoft.Exchange.WebServices.Data.ItemSchema]::Subject,[Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeSent,[Microsoft.Exchange.WebServices.Data.EmailMessageSchema]::ToRecipients)

$InboxFolder= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$Mailbox)
$Inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($s,$InboxFolder)
Write-Host 'Total Item count for Inbox:' $Inbox.TotalCount

 

More to follow,

Doug

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (66,569)