Send email based on two columns

I want to send email based on the two columns first I have zip folder’s as mentioned in sheet.

I want send this folders on respective emails, with email matched with Respective B code with A.

Hello @Anil_Potekar

Excel Application Scope:

  • WorkbookPath: Path to your Excel file

For Each Row:
- Input: DataTable from the Read Range activity

  Assign:
     - Variable: zipFolder
     - Value: row("ZipFolderColumn").ToString()

  Assign:
     - Variable: emailAddress
     - Value: row("EmailColumn").ToString()

  Send Outlook Mail Message:
     - To: emailAddress
     - Subject: "Your Subject"
     - Body: "Your Email Body"
     - Attachments: zipFolder

Thanks & Cheers!!!

Not separate email need to create group based on the code A&B IN code column.

Hi @Anil_Potekar

  1. Read the Excel

  2. Use For Each Row (1st For Each)

  3. If row(“A/B Code”).ToString.Trim.ToUpper = “A”
    emailList = New List(Of String) - Use Assign Activity

    Use another for each (2nd For Each)
    Use If Condition - If Not String.IsNullOrWhiteSpace(row(CurrentRow).ToString)
    emailList.Add(row($“Email {i}”).ToString) - Use Assign Activity

Outside the For Each (2nd For Each)

Use IF Condition -
emailList.Count > 0 AndAlso File.Exists(“path to the folder” + row(“ZipFolderName”).ToString + “.zip”)

Use Send SMTP/Outlook Mail Message activity
’ To: String.Join(“;”, emailList)
’ Attachments: “path to the folder” + row(“ZipFolderName”).ToString + “.zip”

Hope this helps

1 Like