Getting error in sending email with asset value

Hi all,

Can anyone help me how can store multiple emails in asset and send email to all those recipients at single time. Here I’m using graph API for this.

Example email which i have written in asset when I try to pass direct asset value it’s giving me error.

nick@gmail.com;sam@gmail.com;mac@gmail.com

Hi @Learner007 ,
Can you share image your activity?
regards,

@Learner007
How to write multiple value in Assets - Help / Studio - UiPath Community Forum

1.Retrieve the email addresses from the asset as previously mentioned.

2.Join the email addresses into a single string using a delimiter, such as a semicolon.

3.Use the Microsoft Graph API or any email activity in UiPath to send the email to all recipients at once, specifying the joined email addresses in the “To” field.

Here’s a simplified example using the “Send Outlook Mail Message” activity

Assign emailAddressesArray = EmailRecipients.ToString.Split(“;“c)
Assign emailAddressesTo = String.Join(”;”, emailAddressesArray)

Send Outlook Mail Message
To: emailAddressesTo
Subject: “Your subject”
Body: “Your message body”

If you’re using the Microsoft Graph API, you can pass the emailAddressesTo string as the recipient list when sending the email.

This way, you’ll send the email to all recipients listed in the asset at once.

@Learner007

Hi @Praveen_Mudhiraj I’m getting error when I try to run it.

At least one recipient is not valid, jame@gmail.com;tan@gmail.com is not resolved. All recipients must be resolved before a message can be submitted.

Make sure that all email addresses are in a format that is recognized as valid by the email sending service (Outlook, Microsoft Graph API, etc.).

You can address the issue follow this steps:

  1. Check Email Addresses: Double-check that all the email addresses in the asset are valid and correctly formatted. Make sure there are no extra spaces, misspellings, or invalid characters.
  2. Whitespace and Delimiters: Ensure that there are no extra spaces before or after email addresses in the asset, and that the semicolon " ; " is used as a delimiter to separate the addresses.

Hi @Praveen_Mudhiraj with the same asset i tried to send individual emails it worked but when I add ; email to email it is giving me error. There are no space in between e-mail or after delimiter also.

Individual emails are successfully but multiple is failing, so the issue might be related to the specific email sending activity or API you’re using.

Some email services and APIs may have restrictions or requirements when sending to multiple recipients using a single string. In this case, it might be helpful to contact the support or documentation for the email service or API you are using for clarification.

follow this steps : -

  1. Array of Recipients: Consider sending emails to multiple recipients using an array of email addresses, instead of a semicolon-separated string. Some email activities or APIs may accept an array of email addresses as input.

Note :- you can try this it will work ( SMTP or Outlook )

  1. SMTP Server Directly: If you are using an SMTP server for sending emails, you can use a custom SMTP activity in UiPath and provide a list of email addresses as recipients in the “To” field. This may allow you to send the email to multiple recipients without encountering the error.

@Learner007

Sure @Praveen_Mudhiraj will try that.

Sure and let me know its working or not for you

@Learner007

Thanks @Praveen_Mudhiraj this worked and modified little bit from my end.

1 Like

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