The STMP parameters double as a switch.
If SMTP* parameters are not empty, then package only tries via SMTP.
If SMTP* parameters are empty, then package will use ns_sendmail, which should work similar to your test (at prompt line).
cheers, Ben