I am trying to send an email using the Outlook Send Email too. I am capturing the email address by using an Input Dialog Box. I am saving the email address as a String in the variable EmailRecipient. But when I try to execute the bot, I get a message saying my email address is unresolved. So instead of using the variable to strore my email address, I simply typed the email address into the To: Field of the Sen Email box. It worked perfectly so for some reason my email address is being altered when I save it as a variable. The image that I have included shows the Input Dialog box, the variable, the variable type, and the To:Field of the Send Email box. This configuration does not work, but if I simply type my email address in the To:Field, it works perfectly.
This usually happens because the email address you’re capturing from the Input Dialog includes hidden characters ,things like a trailing space or even a newline.
Outlook’s Send Email activity reads the value exactly as it is.
With a space at the end will cause Outlook to treat it as an unresolved address.
Give a try on adding Trim() on your email variable
EmailRecipient.Trim in the To: field. That removes any extra spaces or line breaks and makes the email address valid.
@jcoleman You’re actually using the right type — String is correct for email addresses .From what you described, this usually happens because of formatting issues from the Input Dialog (extra spaces or line breaks). Try doing a .Trim on the variable before using it: EmailRecipient = EmailRecipient.Trim Also make sure in the To field you’re passing the variable directly (without quotes). If it still doesn’t work, just log the value once to check if anything extra is coming in: “[” + EmailRecipient + “]” Most of the time it’s just hidden spaces causing the “unresolved” issue
Thank you for the tips. Unfortunately, neither of them worked. I did check for extra spaces using the method that Dhruba suggested, but there were no extra spaces.
@jcoleman Thanks for checking that. Since spaces are already ruled out, let’s try a couple more things step by step: Try assigning a hardcoded value to the same variable: EmailRecipient = “test@test.com” → If this works, then the issue is definitely with the Input Dialog value. Let me know what you see after step 1 ..
then create an new varriable ‘arr_EmailRecipients’ of type String array
Before we assign ‘arr_EmailRecipients’
we need to convert string (EmailRecipient) to string array based on delimiter (use ‘,’ - if have multiple mail address to send. example- if you enter abc@gmail.com, xyz@gmail.com in input dialog box, mail will be sent to these two ids.)