Outlook - How to automate downloading files and send it as email.

Pawandeep Singh 1 Reputation point
2022-07-15T21:52:46.397+00:00

Hi Everyone,

I wanted to achieve the below-mentioned task through the outlook Application.

  • Download the pdf file from weblink attached with the incoming email.
  • Send those files to specified emails automatically.
  • The unique identifier will be the subject line comping from a specific email address

Any kind of help or feedback will be appreciated.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,553 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,369 questions
Outlook | Windows | Classic Outlook for Windows | For business
{count} votes

2 answers

Sort by: Most helpful
  1. Dillon Silzer 57,831 Reputation points Volunteer Moderator
    2022-07-16T02:13:17.577+00:00

    I would look into using Power Automate for downloading files automatically into a folder:

    AUTOMATICALLY Save Email Attachments | Using Power Automate (create different folders by topic) by Leila Gharani

    https://www.youtube.com/watch?v=_jh7snqA4e4

    Once you have that Power Automate flow running, you should look at setting up:

    Send OneDrive files to an email

    https://powerautomate.microsoft.com/en-us/templates/details/3e19048d2cd74427aedc6374afdac8fe/send-onedrive-files-to-an-email/

    Once you have both flows running, it will automatically download e-mails from a specific sender (or a specific subject line) and then the second flow will take care of e-mailing new OneDrive files that have been downloaded to the folder.

    -----------------------------

    If this helps please mark as correct answer. Hope this is helpful.

    0 comments No comments

  2. Kamlesh Kumar 3,866 Reputation points
    2022-07-17T05:01:26.827+00:00

    Hi @Pawandeep Singh ,

    Welcome to Microsoft Q&A Platform. Thank you for the question.

    Here you can follow the 2 alternative approach that could help you to achieve your scenario,

    1. You can link a Azure Function App with your Logic App. This way when an email is received (Logic App trigger ) you can call the function app and pass the email body to it, then you can write a code which can extract the required link and then pass it back to logic app. You can follow this tutorial to some extent, you might have to tweak some conditions and code.
    2. You can follow the solution mentioned in below. This method totally depends on the format of the email and given that there is a single link in the email body. Please refer below for implementation.

    221475-image.png

    Please refer the related question for more information.

    Created a sample LA workflow with your scenario and below are the sample design for the same.

    substring  
    (  
      substring(outputs('html'), indexOf(outputs('html'), 'https://cloudshell1138451457')),   
      0,  
      indexOf(substring(outputs('html'), indexOf(outputs('html'), 'https://cloudshell1138451457')), '"')  
    )  
    

    221466-image.png

    Regards,
    Kamlesh Kumar
    BizTalk Techie

    Please don't forget to click on 205836-130616-image.png or upvote 205759-130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is How

    Want a reminder to come back and check responses? Here is how to subscribe to a Notification

    If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.