MailMessage Iteration

Hi there,

Can anyone tell me what is wrong with the below:

What would I need to change in the Condition of the If activity to obtain the subject of the mail message?
What would I need to put in the right-hand field of the Assign to assign the current MailMessage in the loop?

Hi @Mark.Edgeller

Use mail.subject.ToString.contains(“hello”)

Give a Boolean flag =true

Thanks
Ashwin.S

1 Like

Fine
You were almost done

ensure that Type argument property in the property panel of FOR EACH activity is set as System.Net.Mail.MailMessage

Then in IF condition will be with this expression
Mail.Subject.ToString.Contains(“hello”)
If true it will go to THEN part or it will go to ELSE part
So in the THEN part use a assign activity mention like

CorrectMessage = Mail

Kindly try this and let know for any queries or clarification
Cheers @Mark.Edgeller

1 Like

Hi @Palaniyappan

Thank you this makes perfect sense once demonstrated. To extend this, if I then want to extract say, the sender of the CorrectMessage MailMessage I’d use an assign with:

CorrectMessage.Sender.ToString

Is this correct?

1 Like

Exactly buddy
kindly try this and let know for any queries or clarification
@Mark.Edgeller

Cheers