Is it possible to get the Sent Email and Inbox List ,if we send email form Send Exchange Mail server in UIPath

Hi Team,

We have an requirement to send emails to customers from Send Exchange Mail server,after that we have requirement to get the list of Inbox Emails(Which mail messages are not delivered).
Is it possible to do from UI Path?
Appreciate your inputs!

@RajeshT

Use Get Exchange Mail Message activity to read undelivered mails.

2 Likes

Hi @lakshman

How can we get the emails only with the subject “Mail Delivery System” and copy the email id from the body of undelivered email.
Attached my workflow.Read Emails( Inbox_EmailsList)_Exchange Server.xaml (7.4 KB)

@RajeshT

Please check below thread.

1 Like

Hi @lakshman @Palaniyappan

I can able to capture the subject of failed emails ,but i need emails from the body of undelivered emails.
Appreciate your help!
image
Attached my workflow.Read Emails(Inbox and Sent Items_Subject).xaml (7.2 KB)

@RajeshT

  1. After getting mails use ForEach loop to iterate one by one mail.

        ForEach item in mailMessages
              IF item.Subject.Contains("Undelivered")
              Then 
               Item.Body.Tostring
               Else
               Nothing
1 Like

Hi @lakshman ,

I have tried with this code and its copying total body and how can i get only email id from body of email.

1 Like

@RajeshT

Assign the body of the mail to one String variable and then use below Regular expressions to get Email Id from that.

           ^[_a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$
1 Like

Hi @lakshman,

This regular expression not copying the email,could you please check my workflow is correct?
image

@RajeshT

May I know what error are you getting here ?

1 Like

@RajeshT

It should be like this.

         System.Text.RegularExpression.RegEx.Match(yourString,inputPattern).Value

Its not copying anything to text file ,with message box i tried to print and its displaying empty.

@RajeshT

And also you can use below activity and it will give output as collection of matching strings.

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