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.
Hi Ashokkarale,
That did not work. When I changed the variable to system.string, it throws an error in the capture dialog box.
Thanks
Hi @jcoleman
Try using .trim after the variable to check any whitespaces present also you can print this variable in log message and check the expected email address is coming correctly without any special characters including with email address
@jcoleman The issue was with variable scope. Even though the variable was created, the Send Email activity couldn’t access it properly.
What I did:
-
Created the variable (EmailRecipient / EmailList)
-
Changed its scope to Global
-
Used Assign →
EmailList = New List(Of String) From {EmailRecipient.Trim} -
In Send Email → To field, selected the variable using + icon (not typed manually)
After this, it worked
Hello @jcoleman,
-
Let the ‘EmailRecipient’ variable be string
-
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.)
Use - EmailRecipient.Split(","c)
-
Assign arr_EmailRecipients → EmailRecipient.Split(","c)
-
Use arr_EmailRecipients in ‘To’ property of Send Email.
Hope it helps!
@jcoleman Is this working now?
Hey! Since you’re getting an ‘unresolved’ error only when using the variable, it’s almost certainly a formatting issue rather than the variable type (String is definitely the right one to use).
Input Dialogs sometimes pick up hidden spaces or line breaks. Try adding .Trim to your variable in the ‘To’ field, like this: EmailRecipient.Trim.
Also, double-check that you aren’t wrapping the variable name in quotes in the activity property - it should just be the name of the variable itself.
Hello,
Email addresses can usually be stored as strings.
If youre working with full emails, youll use MailMessage.
if you have multiple emails, youll use List(Of String).
if the email comes from excel or a database youll use Datatable.
Hope this helps. ![]()




