Use command -v to check for sendmail

Fix #7559