>please suggest for this issue resolution.
I suggest that you forget the whole programming exit. There is absolutely no need to use it. It just makes simple things complicated. If your aim is just to send email, use the standard email sending step in the workflow builder. Or alternatively, use the Extended Notifications, which can be configured to send emails to approvers/agents.
Regards,
Karri