Learn how to automate the process of sending emails to multiple recipients with UiPath using data stored in an Excel sheet. This guide will walk you through each step to streamline your email workflow with UiPath, leveraging Excel and Outlook integrations. Ideal for automating bulk emails in a professional setting.
Step 1 : Prepare Your Excel File
- Open Microsoft Excel and create a new worksheet.
- In the first column, add the email addresses of the recipients.
- Add additional columns for details such as subject lines or personalized message content if needed.
- Save the file in an accessible location with a memorable name, such as
Email_Recipients.xlsx
.
Step 2 : Open UiPath and Load the Excel File
- Start a new UiPath project or open an existing one.
- Use the “Excel Application Scope” activity to open the Excel file. Set the path to your
EmailLog.xlsx
. - Use the “Read Range” activity within the Excel Application Scope to read all recipient data from the Excel sheet. Save this data to a variable of type
DataTable
, e.g.,recipientDataTable
.
Step 3: Loop Through Each Recipient
- Drag and drop the “For Each Row” activity to loop through each row in
recipientDataTable
. - For each row, retrieve the recipient’s email address and any other relevant details (like names or personalized message content).
Step 4: Set Up the Email Activity
- Use the “Use Desktop Outlook App” activity to connect with Outlook.
- Inside the Outlook scope, use the “Send Outlook Mail Message” activity to create your email.
- To: Set to
row("Email").ToString
to dynamically assign the recipient’s email address. - Subject: Enter the subject line or assign a personalized one using data from the Excel file.
- Body: Write the message body or use the data to personalize content as needed.
- To: Set to
- (Optional) Configure any additional settings, such as attachments, CC, or BCC.
Step 5: Run and Test the Workflow
- Save your workflow and test by running it in UiPath.
- Check your Outlook outbox or sent folder to confirm the emails have been successfully sent.
Conclusion: By following these steps, you can efficiently automate email distribution to multiple recipients using UiPath, making bulk communication seamless and error-free. This approach saves time, reduces repetitive tasks, and enhances productivity.