Note that you're subject to attacks by passing unescaped text to the shell.
In reply to Re: Checking mail command for success by ikegami in thread Checking mail command for success by ronix