APP_NAME returns the application name for the current session.
Example:
select APP_NAME();
Result:
Microsoft SQL Server Data Tools, T-SQL Editor
send failed, exception: javax.mail.MessagingException: Could not connect to SMTP host: , port: 25;
nested exception is: java.net.SocketException: Network is unreachable: connect