Auto Extraction of Email

Hello All,

I am currently looking for a way to have RPA email the user logged in when the code is done. The problem I run into with this is that I don’t know every user that will be logging in so I need a way to automatically pull the default email address (outlook) of the computer. Or perhaps another method?

Any help would be appreciated,
Thank you!

Can do! if you have a way of getting a hold of a master list from Exchange (Fields: Username, Email Address) you could use an assign activity to:
set a variable equal to: System.Environment.UserName
and then reference the variable against the master list“Username='” + variable + “'”)(0)(1).toString

I hope this works! Its not fun trying to pull the email address from the active user!

Your not going to believe this but this works too (they send THEMSELVES an email, it SHOULD work in an enterprise environment with AD, you have to enable some things in outlook)

1 Like

How might one get a hold of a master list to pull email address?This looks exactly what I am looking to do. Currently I am pulling the username with a “Get Environment Variable” Activity
Or by Master list do you mean a manually maintained list?

They send themselves an email also sounds like a perfect fit, but I am not sure how to go about that… I am still very new to rpa so I apologize if too many questions.
Thank you,

I cant help you get the master list unfortunately :frowning:

however…UiPath lets us drop in files :slight_smile:
Here are the activities I used to send myself an email. I hope it works for you!

sendYourselfAnEmail.xaml (4.6 KB)

Thank you for your help and dropping in the file. This solution seems to not work for me due to my code being pulled in as opposed to an email being pulled. I get the following error:

could you try something out for me? Open outlook > create new email> put your username in the To: line > click tab> try and send message

I tried this and Outlook said that it did not recognize a user with this name. Our employee code does not refer to our email address sadly which causes trouble in these scenarios

If that’s the case I would reach out to the Exchange Administrator to see if they could get you that list. sorry it didnt work :frowning:

There ARE methods of pulling the active user’s email address- its requires more custom code to get that kind of functionality. Getting the list would be the easiest option for you. Now that I think about it- this might be a great idea for a custom activity @loginerror what do you think?

1 Like

Thanks, I added your idea to our internal ideas tracker, who knows :slight_smile:

As to the issue at hand, is this an unattended process? Otherwise, if the process is attended, you could simply ask the user for their email, I suppose.

No reason to apologize at all. I am thankful for your help! I will attempt finding a list of sorts in order to work with, since I don’t know what kind of custom code would be required.

Thank you again,

Currently I have the process asking for an email, however I have been asked to move away from this method of doing so. My only other thought at the moment is pulling the local application folder, drilling down to the email folder, and trying to pull a file name if it includes an @ symbol.

I suppose one way to go a step forward would be to program the process so that it only asks for the email once, and then stores it somewhere in user profile (Documents?) for future executions.

Another way, I think, could be to use PowerShell in case the email account = the account email of the user in the domain.
I found this PowerShell script that could be useful here:

([ADSI]("LDAP://" + (whoami /fqdn))).mail


1 Like

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