How to verify mail utilities are functioning correctly with nhMail

Document ID : KB000023179
Last Modified Date : 14/02/2018
Show Technical Document Details


How to verify mail utilities are functioning correctly with nhMail





On a Unix system, eHealth uses the /bin/mail utility (which makes use of the /usr/lib/sendmail utility) to send mail

Note: By default, on Solaris, Sendmail logs it's activity to /var/adm/messages.  To verify the proper log file, see /etc/syslog.conf.  The following is an example of the default entry in syslog.conf:

        *.err;kern.debug;daemon.notice;mail.crit        /var/log/messages

To test if mail is functioning properly on the system, follow the procedure below.

  1. Open 2 command shells, and in the first type: 

    $ tail -f /var/adm/messages

  2. In the second shell, type the following:

    nhMail <yourusername@domain name> $NH_HOME/           

    Example:  nhMail

In the first shell, sendmail will log a message similar to the following if the mail was handled successfully:


Jul 19 14:53:11 ohio sendmail[9279]: [ID 801593] j6JIrAi09279: from=ehealth, size=5476, class=0, nrcpts=1,
msgid=<>, relay=ehealth@localhost

Jul 19 14:53:11 ohio sendmail[9281]: [ID 801593] j6JIrAi09279:, ctladdr=ehealth (1002/10), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=125476, [], dsn=2.0.0, stat=Sent (j6JIqcM21168 Message accepted for delivery)

If the second line reports anything besides "Message accepted for delivery", contact your system administrator to fix the mail configuration on the system.


Microsoft Windows

If you do not receive an email after running the following command:


nhMail [name] [filename]

then follow the procedure below.

On a Windows server, eHealth uses %NH_HOME%\bin\nhMail.bat, which calls %NH_HOME%\bin\, which then calls %NH_HOME%/bin/sys/nhiNtMail.exe.

The SMTP server (Mail relay) is defined in the NH_NT_SMTP_SERVER environment variable.  Often, this variable is either misconfigured or not configured (please see  Defining the SMTP server)

If email is not working after confirming the NH_NT_SMTP_SERVER variable, run the following command:

For Usage type: nhiiNtMail -h

  1. From a command prompt type:

    nhiNtMail   filename -t -v

An example of the output is shown below:


Recv: 220 ESMTP Sendmail Switch-2.2.8/Switch-2.2.6; Tue, 31 July 2005 18:41:22 -0500 (EST)
send: HELO
Recv: 250 Hello [] (may be forged), pleased to meet you
send: MAIL FROM:<>
Recv: 250 2.1.0 <>... Sender ok
send: RCPT TO:<>
Recv: 250 2.1.5 <>... Recipient ok
send: DATA
Recv: 354 Enter mail, end with "." on a line by itself
send: Return-Path:
send: Subject: test
send: Date: Tue, 31 July 2005 18:42:14 PM EST
send: From:
send: To:
Recv: 250 2.0.0 i0RNfMV01018 Message accepted for delivery
>: Q.UIT
Recv: 221 2.0.0 closing connection


If there is a problem with the file, the local delivery agent, sender/recipient address, or mail relay, the output will reveal where the problem lies.