Use which("sendmail") to get the abspath of the executable