How to get mail message from particular sender


#1

How to get mail messages from particular sender…
I just want to see mails of particular user using IMAP


#2

HI @ImPratham45,

Refer this link,

Regards,
Arivu


#3

What @arivu96 shared is very useful. See attached workflow -

Main.xaml (6.7 KB)

In such way you can have if condition and filter messages on the basis of Name, Address, Subject etc.

In attached workflow just apply a if condition in for each loop like this -

if(item.From.Address.Contains(“XYZ”)) then your stuff


#4

here we filter the body how to get mail from particular sender say , I want to see messages/mails from YouTube

I tried these :
items.From.Address.contains(“xyz”) but i am not getting any output so my question is which expression should I use for fetching mails from particular user


#5

It Will work.before filtering check whether that mail id any mails came or not.
mail.From.Address.Contains("xxx@YYY.com")

Regards,
Arivu


#6

I have tried this but it shows : above pic


#7

I also tried this:

Still answer getting in message box is “nothing”

but in inbox there are message from that mail id


#8

Have you changed TypeArgument for For Each loop to System.Net.Mail.MailMessage?

image


#9

Hi @ImPratham45,

Use ".ToString() "

item.From.Address.Contains("xxx@ddsf.sdf").ToString()
It will return the Boolean value.

Use if condition check

Regards,
Arivu


#10

yes @prankurjoshi


#11

it gives false condition but in my inbox there are mails from that user


#12

send your xaml file i ll check and update you @ImPratham45


#13

Main.xaml (10.9 KB)

I just remove email and pass so kindly correct it


#14

This is working for me. Just one thing why have you again used Get IMap message activity in if condition?


#15

for deleting the mail which is from that user


#16

actually i get a task in which i need to delete all the mails from YouTube/Facebook so i am trying to do this things


#17

Please check DeletedMessages property in Get IMAP Message activity -


#18

ya but it is not going in then of IF loop it goes in else only