Office 365 unable to send email to multiple recipients

I am unable to send email to multiple recipient because UiPath is considering the emails as signle string. But it is working fine with single email. I have triied both seperators ( ; and comma ) but it is sending email with this email pattern : i am attatching ss of how it is writing email

Hello @Zainab_Zaidi

  1. Assign - Create a List variable

    • Name: recipientsList
    • Type: List(Of String)
  2. Add To Collection - Add email addresses to recipientsList

  3. Add To Collection - Add more email addresses as needed

  4. For Each - Iterate through recipientsList

    • TypeArgument: String
    • Values: recipientsList

    Inside the For Each loop:
    5. Send Outlook Mail Message - Configure the email message

    • To: item (the current email address in the loop)
    • Subject: “Your Subject”
    • Body: “Your Email Body”

Thanks & Cheers!!!

@Zainab_Zaidi

Office 364 needs an array of items

Try with this

Stremail.Split({";"},StringSplitOptions.None)

Cheers

I am reading emails from excel , not hardcode, when i have single email its working fine but when i am using two recipients it is throwing error please note that i am using office 365 online and the only value variable which send email activity allowing is : Ienumbarle Variable which i am calling with {}

Still Same Issue. I am reading emails from excel , not hardcode, when i have single email its working fine but when i am using two recipients it is throwing error please note that i am using office 365 online and the only value variable which send email activity allowing is : Ienumbarle Variable which i am calling with {}

Hi @Zainab_Zaidi ,

Is it possible for you to show us the Screenshot of the Activity used and the Error Message if present?

@Zainab_Zaidi

yes that is the reason I asked you to split in the given formula strEmail is the string retreived from config

I believe as of now you gave like this {strEmail} instead give the above formula without brackets

cheers

@Zainab_Zaidi

  1. Read Range - Read email addresses from Excel into a DataTable (yourDataTable).

  2. Assign - Convert the DataTable to a List of email addresses.

    • recipientsList = (From row In yourDataTable.AsEnumerable()
      Select row.Field(Of String)(“EmailAddress”)).ToList()
  3. Send Email - Send an email to each recipient using a For Each loop.

    • To: currentRecipient
    • Subject: “Your Subject”
    • Body: “Your Email Body”
    • Recipients: recipientsList

Yes Brother Issue Resolved With This Solution Thanks Alot :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.