0% found this document useful (0 votes)
550 views10 pages

(RPA) - Using The Microsoft Office 365 Activity For Sending Emails in UiPath - The JPanda

This document discusses how to use the Microsoft Office 365 activity in UiPath to send emails with attachments. The key steps are: 1) Create an app registration in Azure and get the application and tenant IDs; 2) Install the UiPath.MicrosoftOffice365.Activities library; 3) Add a "Microsoft Office 365 Scope" activity and configure it with the IDs; 4) Add a "Send Mail" activity and configure its properties; 5) Add activities to assign file paths from a folder to variables for attachments.

Uploaded by

Vicente Miranda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
550 views10 pages

(RPA) - Using The Microsoft Office 365 Activity For Sending Emails in UiPath - The JPanda

This document discusses how to use the Microsoft Office 365 activity in UiPath to send emails with attachments. The key steps are: 1) Create an app registration in Azure and get the application and tenant IDs; 2) Install the UiPath.MicrosoftOffice365.Activities library; 3) Add a "Microsoft Office 365 Scope" activity and configure it with the IDs; 4) Add a "Send Mail" activity and configure its properties; 5) Add activities to assign file paths from a folder to variables for attachments.

Uploaded by

Vicente Miranda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

The JPanda
All Things Automation et al.

[RPA]: Using The Microsoft Of ce 365 Activity


For Sending Emails in UiPath
Jacqui Muller January 27, 2020 Microsoft, RPA

Level of Difficulty: Beginner.

This post will assist in using the Microsoft Office 365 Activity, specifically for sending
emails with attachments, in UiPath.

What are the steps?


The steps that we will be following are:

1. Follow the link on how to create an App Registration on Azure


2. Get the Application ID and Tenant ID from Azure
3. Install the UiPath.MicrosoftOf ce365.Activities library
4. Add a “Microsoft Of ce 365 Scope” Activity
1. Con gure the “Microsoft Of ce 365 Scope” activity
5. Add a “Send Mail” Activity
1. Con gure the activity

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 1/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

6. Add an “Assign” Activity


1. Assign the les in the directory to a variable
7. Add an “Assign” Activity
1. Assign the converted attachments variable to IEnumerable<String>
8. Add IEnumerable<String> variable to the “Send Mail” activity’s
AttachmentCollections property

Deep Dive
Let’s dive deeper into the steps listed above.

Getting the Application ID From Azure


Once you have logged into Azure (https://portal.azure.com/), go into the Azure
Active Directory:

Select App registrations and then search for your application. Click on your
application when it appears.

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 2/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

Copy the Application ID and the Tenant ID and keep it for later use, when
configuring the Microsoft Office 365 Scope:

Now that we have our info from Azure, let’s get started in UiPath.

Install the UiPath.MicrosoftOf ce365.Activities library


Create a new UiPath Process, add a sequence to the Main.xaml file and click
“Manage Packages” as seen below:

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 3/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

Ensure that focus is on “All Packages” when searching for


UiPath.MicrosoftOffice365.Activities.

Select the UiPath.MicrosoftOffice365.Activities library and click on the Install


button. After clicking the install button, click on Save and Accept when prompted:

Now that we have the library installed, we can wire our process up to use the MS
O365 capability.

Add a “Microsoft Of ce 365 Scope” Activity


Search for “Microsoft” in the Activities panel and drag the “Microsoft Office 365
Scope” over into the Sequence sitting in the Main.xaml file:

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 4/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

Con gure “Microsoft Of ce 365 Scope” Activity


Ensure that you configure the following properties correctly:

Application ID: Application ID obtained from Azure


Authentication: Interactive token should be the default and easiest to use, however,
it would depend on the security level that is applied to your user on the app
registration
Services: For sending and reading mails, the Mail service should be selected
Tenant ID: Tenant ID obtained from Azure

In the activity pane, find the “Send Mail” activity (Integrations > Office 365 >
Outlook) and drag it into the Microsoft Office 365 Scope:

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 5/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

Configure the Send Mail properties as follows:

Body: The text that should be included in the email body


Subject: The subject that should appear in the email subject
From: The email address that the mail should be sent from
To: The email address (or email addresses) that the mail should be sent to
AttachmentsCollection:
{} if there are no attachments
IEnumerable String variable that contains the paths of the attachments if
there are attachments

The other properties may be configured and adjusted as necessary.

Adding Attachments From Folder


In a case where there are files in a folder that need to be attached, add an “Assign”
activity. Create a variable (of Type String[]) named attachments and use the
assign activity to assign it to System.IO.Directory.GetFiles(“\Attachments”)

Since the Send Mail activity accepts the attachments collection as the
IEnumerable<String> type, the attachments variable needs to be converted from an
array of string to an IEnumerable of string. This can be done by grabbing another
“Assign” activity and using it to assign a new variable, named
attachmentEnumerable (of type IEnumerable<String>) to
attachments.AsEnumerable().

Now add the attachmentEnumerable variable to the AttachmentsCollection


property of the “Send Mail” activity.

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 6/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

The final process should look like this:

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 7/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

And that’s it folks! Give it a run and feel free to drop a comment about how it turns
out.

The above solution is available at on Github

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 8/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

If you have any questions, issues or feedback, drop a comment below or reach out to
[email protected]

Share this:

 Twitter  Facebook

Like
Be the first to like this.

Related

[RPA]: Uploading Files to [RPA]: Using The Python [Automation]: Monitoring


Azure Blob Storage in Activity in UiPath Gmail Inbox Using Python
UiPath Processes In "Python" In "Automation"
In "Automation"

Jacqui Muller January 27, 2020 Microsoft, RPA

Published by Jacqui Muller


I am an automation architect by current profession who enjoys dabbling in software
development, RPA, IOT, advanced analytics, data engineering and business
intelligence. I am aspiring to complete a Master's degree in Computer Science within
the next two years. My competencies include a high level of computer literacy as well
as programming in various languages. I am passionate about my field of study and
occupation as I believe it has the ability and potential to impact lives - both drastically
and positively. I come packaged with an ambition to succeed and make the world a
better place. View more posts

2 thoughts on “[RPA]: Using The Microsoft Of ce 365


Activity For Sending Emails in UiPath”

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 9/10
15/02/2021 [RPA]: Using The Microsoft Office 365 Activity For Sending Emails in UiPath – The JPanda

ajit nayak
October 31, 2020 at 10:06 am

well explained step by step.


do you have something similar to work on SharePoint ?

 Like
Reply

Jacqui Muller
November 26, 2020 at 5:41 am

Hi ajit. Not yet. Is there a speci c use case? I’d be more than happy to create a post
for it.

 Like
Reply

Leave a Reply
Enter your comment here...

The JPanda, Blog at WordPress.com.

https://thejpanda.com/2020/01/27/rpa-using-the-microsoft-office-365-activity-for-sending-emails-in-uipath/ 10/10

You might also like