New Email with Attachment of a New Excel Sheet


I am working on a lab with UiPath and I am having an issue with one particular part. I am using an Excel filing, going through each row and adding specific rows to a new excel file. I need to send this new Excel file (which is created during the run) as an attach in an email. What is the best way to do this? Since my new Excel sheet is created above, I am having a hard time referencing it again in order to send it. I also don’t know which of the many email activates to use. I am new to UiPath and any assistance, tips, or advice is greatly appreciated. Thank you all!

Hi @CF12000

You can use the following way to send emails

  1. Use Excel Application Scope to create the new Excel file.

  2. Perform operations to populate the Excel file.

  3. Store the file path of the new Excel file in a variable.
    ** Example: **
    ** Assign → filePath = “C:\Path\to\your\file.xlsx”**

  4. Use the Send Outlook Mail Message or Send SMTP Mail Message activity to send the email.
    ** Fill in the required email details (To, Subject, Body, etc.).**

  5. Add an attachment to the email:

    • Attach the file using the ‘Attach Files’ property of the email activity.
    • Set the value of ‘Attach Files’ to the variable storing the file path.

For Ref:-

Hope this helps :slight_smile:


Read and Process Excel:
Use the Excel Application Scope activity to read the data from your original Excel file.
Add activities within the scope to process the data.
1.Create and Save New Excel File:
Use the Write Range activity to create and save the new Excel file.
Specify the range and the path where you want to save the file.
2.Send Email:
Use the Send Outlook Mail Message(smtp- , SMTP port-587)
Send SMTP Mail Message activity(, port- 465 ).
Configure the email details like “To,” “Subject,” and “Body.”
3.Attach the Excel File:
locate the “Attachments” property.
Use the full path to the newly created Excel file.