How to get sender mail ids from inbox folder in outlook

Hi all,

How to get the sender mail ID’s from inbox folder. If the sender mail domain is @xyz.com then no need to take that particular mail id’s else need to take the sender mail id’s from outlook.
How to do this, please guide me on this.

@lakshmi.mp

-Drag and drop the “Get Outlook Mail Messages” activity onto your workflow.
-Configure the activity by specifying the account, folder (Inbox), and other necessary parameters.

-Use a “For Each” activity to iterate through each email retrieved by the “Get Outlook Mail Messages” activity.

-Inside the loop, use the following steps to get the sender’s email address:

-Use the expression email.Sender.Address to get the sender’s email address.
-Store the sender’s email address in a variable.
-Use an “If” activity to check if the sender’s email domain is ‘@xyz.com’. If yes, skip that email; if no, proceed to the next step.

-If the email has a sender with a domain other than ‘@xyz.com’, you can perform the desired actions (e.g., store the email address in a list, process the email, etc.).

Cheers…!

@lakshmi.mp

you mean you want the from email when you get the mails?

if so first use get mails and then loop through output of it

and inside loop use mails(0).From.Address to get the mail id

use if codnition to check the domain @xyz.com

if you need all at one with comma separation use

String.Join(",",mails.Where(function(x) Not x.From.Address.Contains("@xyz.com")).Select(function(x) x.From.Address))

cheers

Hi @lakshmi.mp ,
Have you tried

regards,

@Dilli_Reddy ,

image
sender address not showing.

What changes need to do.

@Nguyen_Van_Luong1 ,

currentItem.From.Address

Used this inside for loop. But it’s not displaying the sender’s name. Please guide me, what changes i need to do.

Hi @Anil_G ,
Used

currentItem(0).From.Address

image
getting this error, what changes need to do. Please help me on this.

@lakshmi.mp

if you are using loop already then remove (0) directly use currentItem.From.Address

cheers

@Anil_G ,
Using outlook web app, i am not able to login. Please look in to the screenshot.
image
What changes i need to do. Please guide me on this.

@lakshmi.mp

Please check the exception details from locals panel when run in debug mode

Cheers

@Anil_G ,
Please look into the screenshot
image

@lakshmi.mp

exception details from locals panel please

run in debug

cheers

image
Have a look over screenshot

@lakshmi.mp

Please try to follw

  1. Run in debug
  2. When error comes open the lcoals panel
  3. Expand or click on magnifier beside exception details and then show the exception detaila here.

Because that will show the exact exception message completely

Cheers

@Anil_G ,
Please check this…

RemoteException wrapping MailKit.Security.AuthenticationException: LOGIN failed.
at MailKit.Net.Imap.ImapClient.AuthenticateAsync(Encoding encoding,
ICredentials credentials,
Boolean doAsync,
CancellationToken cancellationToken) in D:\src\MailKit\MailKit\Net\Imap\ImapClient.cs:line 1265
at MailKit.Net.Imap.ImapClient.Authenticate(Encoding encoding,
ICredentials credentials,
CancellationToken cancellationToken) in D:\src\MailKit\MailKit\Net\Imap\ImapClient.cs:line 1320
at MailKit.MailService.Authenticate(ICredentials credentials,
CancellationToken cancellationToken) in D:\src\MailKit\MailKit\MailService.cs:line 1237
at UiPath.Mail.UiPMailKit.Extensions.IMailServiceExtensions.Authenticate(IMailService service,
UserSettings userSettings,
CancellationToken cancellationToken)
at UiPath.Mail.MailServiceFactory.CreateMailKitService(EmailProtocol protocol,
String server,
Int32 port,
UserSettings userSettings,
SecureSocketOptions options,
Int32 timeout,
CancellationToken cancellationToken)
at UiPath.Mail.MimeMailService.GetIMAPMessages(UserSettings userSettings,
ServerSettings serverSettings,
Int32 top,
String mailfolder,
String filterExpression,
String charset,
EOrderByDate orderByDate,
SecureSocketEncryption SecureConnection,
Boolean deleteMessages,
Boolean onlyUnreadMessages,
Boolean markAsRead,
Action1 logAction, CancellationToken cancellationToken) at UiPath.Mail.IMAP.Activities.GetIMAPMailMessages.<>c__DisplayClass76_0.<GetMessages>b__0() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread,
ExecutionContext executionContext,
ContextCallback callback,
Object state)
— End of stack trace from previous location —
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread,
ExecutionContext executionContext,
ContextCallback callback,
Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot,
Thread threadPoolThread)
— End of stack trace from previous location —
at UiPath.Mail.Activities.Extensions.TaskExtensions.TimeoutAfter[TResult](Task`1 task,
Int32 timeoutMs)
at UiPath.Mail.Activities.GetMailActivity.ExecuteAsync(AsyncCodeActivityContext context,
CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Mail.Activities.BaseMailAsyncActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

@lakshmi.mp

Config

As per error creds look wrong

Cheers

@Anil_G ,
image
this screen not able to see

Sign in to your account

in this link.
And also the credentials are given correct.