Skip to main content

Email Attachment Download

Let us automate connecting to the email server, search for a particular email, open the email and download the attachment.

Here are the high-level tasks involved in completing this hands-on tutorial:

  • Gmail Portal XPath Mappings

  • Following three snippets are created.

    • Get_XPathMap_Dic.xaml - We are going to read the config CSV and add it to the XPath dictionary with XPath as value and string constant as Key read from the config file.
    • WebPage_Gmail_Login.xaml - Contains set of Web Automation activities to login into gmail portal.
    • Download_Email_Attachment.xaml - Contains a set of Web Automation activities to open the email and click on download attachment.

Come, let's create this process in Process Designer:

Step#1

Launch and create a new process in Process Designer

  • Launch Process Designer from the Windows Start menu located under IntelliBuddies Enterprise

Step#2

Create New Process

  • Click on New Process and fill in the new process details

Step#3

  • Add variables to hold the input and output details.

Step#4

  • Create a simple sequence to read CSV and add the extracted data into XPath dictionary.

  • CSV and DataTable activities are used in Get_XPathMap_Dic.xaml to create dictionary.

  • Export this sequence as Snippet.

  • Drag and drop this Snippet in the main workflow, which adds invoke workflow activity, pointing to the above snippet workflow.

  • XPath config file

Step#5

Login Email

Step#6

  • Drag and drop invoke workflow activity, pointing to WebPage_Gmail_Login snippet in main workflow which login to provided Gmail account.

Step#7

  • Create a sequence and add activities to search, open the email and click on download link.

  • Click Link,

  • Set Text Field Value and

  • Click Element activities are used to automate open the download link.

  • Export this sequence as Snippet.

  • Drag and drop this Snippet in the main workflow, which adds invoke workflow activity, pointing to the above workflow.

Step#8

  • Save As dialog appears on execution of previous step.

  • Add Desktop VDI Automation Click Image to click on Save button of Save As dialog.

Step#9

Save the process

  • From the Design tab ribbon, click on Save

Step#10

Run the process

  • From the Design tab ribbon, click on Run

Step#11

Make sure the process executes successfully by logging into Gmail, searching for emails, opens and downloads an attachment from an email.

Download Example (C#)