Send outlook Mail message activity execution error

I’m using the “Send Outlook Mail Message” activity in an automation that I’m developing. While testing this activity, I encountered the following error:

“Send Outlook Mail Message: We need to know who to send this to. Make sure you enter at least one name.”

Despite this error message, the email is still being sent to the recipients.

I highly appreciate your assistance.

Thank you!

@Robot2_Automation ,

The error happens when you there is any invalid emails. Please correct the email ID. This should fix the issue

Can an email still be sent if the email addresses are invalid? I don’t think so.

@Robot2_Automation

Can you show the activity properties and specifically what values you are sending in to field

cheers

Hi @Anil_G

I’m extracting email addresses from a column in Excel and storing them in a variable (ToEmail). Multiple email addresses are in that cell, but they are separated by a semicolon in the Excel sheet..

For example:
image

@Robot2_Automation

Can you print the to address values may be it says mailto: in it apart from the email ids

First try to right click in excel cell and then remove hyperlink

Cheers

@Robot2_Automation it’s issue of email id value. The email should not have space and other invalid or forbidden characters like :,; etc.

Log the email id variable and see if any invalid characters are being passed

Hi @Anil_G
I’ve checked, and the value does not indicate “mailto.”

Please refer to the screenshot below.

image

Hi @ashokkarale “I’m extracting email addresses from a column in Excel and storing them in a variable (ToEmail). Multiple email addresses are in that cell, but they are separated by a semicolon in the Excel sheet..” How can i separate the email addresses if semicolon is an invalid character?

@Robot2_Automation,

I use this code snippet to get the email id’s from a cell.

strEmailIds.Trim.Split({";"}, StringSplitOptions.RemoveEmptyEntries).Select(Function(s) s.Trim()).ToArray()

@ashokkarale Can you help me with this? Should I first remove the semicolons from my Excel file and use the code you shared in an assign activity?

@Robot2_Automation

Can you try below.

Copy email address cell value from excel and goto outlook new mail and paste those there. Enter.

Is all of the addresses mentioned there are resolved/identifiable in outlook?

If yes, email addresses looks great. And may be check of before/after space in that excel value. If there, remove and try again

@Robot2_Automation,
No, don’t remove the semicolon. Just pass this code in To property of Send Outlook Mail Message activity

String.Join(";",ToEmail.Trim.Split({";"}, StringSplitOptions.RemoveEmptyEntries).Select(Function(s) s.Trim()).ToArray())

@ashokkarale Tried but still encountering the same error.

Hi @sonaliaggarwal47 - Yeah I did the same. The email addresses look okay when I copy them to Outlook. However, still encountering the same error.