title: How to check whether database mail is working or not?
body: <p>How can I conditionally check whether SQL Server Database Mail is working or not?</p>
  
  <p>Using <code>EXEC msdb.dbo.sysmail_help_status_sp;</code> we can check the status but I want to check the status conditionally like using If condition.</p>