Hello everyone. This is my first post here.
So I am new in UIPath, but I have managed to create a complete flow.
What I find difficult is how to send an email for any error that may happen during the process.
What I have done is this: image|435x284
So all the activities are in try block. But I want to send an email in case of any error in catch block.
Can anyone please help me?
If you want to send emails to notify the error,then keep the send mail activity in the catch block,and follow the below steps:
1.Place Send Outlook Mail activity inside catch Block
2.And set the properties as in below screenshot
In Subject :You can keep it as per your req
In Body:You can add
“Exception occured in Processname.Please find the exception details”+exception.message
Thank you for the reply @geetishree.rao
That’s what I have done, but when an error happens I don’t get any email.
The catch I have used is SystemException. Is this right?
System.Exception is a catch-all. It will catch any type of error.
If you don’t get the email then your send email activity isn’t set up properly. And again, you should probably use Send SMTP Email. It’s simpler and doesn’t require Outlook (which causes its own problems).
Yes, I have the outlook installed.
To be more clear, if I run this process to send me an email when the process executes with no error, it works fine and I get the email.
Only inside the catch block it doesn’t send an email in case of error.
If it is sending mails then the mail functionality is fine…no probs.
As for mail alert for exceptions,are you sure you are getting an error ?
If not try to throw an exception deliberately and check.
It would be good if you could share your xaml,so that I can look into it and confirm.