Bot is not sending the mail

the bot is completing the process but at end it say’s bot failed to close application gracefully. and does not send the mail.


May i know which application bot is trying to close
i hope we are using KILL PROCESS activity to kill an application

and to send mail we are using SEND OUTLOOK or SEND EXCHANGE or any SEND MAIL activity

pls let know if it is something else apart from this

Cheers @sneha_arbole

i am trying to close web browser and a desktop application. and using Send Outlook to send mail


use KILL PROCESS activity and in the PROCESSNAME property mention the application name
say for example if its chrome browser then mention as “CHROME” or if you dont know the processname of the application then open task manager and see the process name of the application you want
once after finding the process name remove .exe from it and just pick the process name and mention in PROCESSNAME property of KILL PROCESS ACTIVITY

and i would like to know what error we are getting with SEND OUTLOOK mail activity
please ensure that the mail recipient in TO property is mentioned correctly and also outlook should be installed in your machine


i should put this Kill Process in End Process Right?

yes @sneha_arbole

Still getting the error. Below is the error i am getting:
Applications failed to close gracefully. Object reference not set to an instance of an object. at Source: Anonymously Hosted DynamicMethods Assembly

no worries
may i know the application names @sneha_arbole


object reference not set error appears if you are passing any null values

Check correctly if you are passing any arguments has no null values

hope this may help you


Sure will check it

Please share the screenshot of property panel of KILL PROCESS activity

@Palaniyappan, @Srini84 ,
Just checked my flow the process is directly going to the catch block in end process, instead of try block in end process.


It’s better you remove the try catch block and run the process where it is giving you the error

Hope this may help you


Tried removing the try catch block but getting the error as Object Reference not set to an instance


As I said before, if you are passing arguments then the value is becoming null value due to that this error raises

For this you can use a write line before the send mail activity and pass all the arguments you are passing to the send mail and check where you are getting the null value

Hope this may help you