I would expect that <i>”communication between CL/QSH and PHP”</i> is <b>not</b> where time is lost. IMO, the more likely problem is the simple creation and destruction of the Qshell environment every time the QSH command is run. That implies creation/destruction of any environments or processes that would be initiated within Qshell.
Since a 5-8 second delay for a simple, single interactive e-mail wouldn’t be too terrible, this would seem to be more of an issue for repetitive processing, perhaps by a batch job or by an interactive invocation a a batch-style processing of a list. If that’s the case, then it seems very inappropriate to issue a QSH command for each individual e-mail. Far better would be to issue QSH only once and have the list processed within the Qshell script itself.
Even better might probably be to use a native e-mail function, e.g., the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzair/rzairsendmime.htm”>QtmmSendMail API</a>, or a freeware utility such as <a href=”http://www.easy400.net/mmailh/intro.htm”>MMAIL</a> from EASY400.