web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Allow .msg files as at...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 2

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

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    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/260699

     

    Best regards,

    Mabel

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.  

  • TowerDefense59 Profile Picture
    2 on at

    Hey @Anonymous 

     

    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard