Sending email in UNIX

can you tell me what is the syntax if I need to keep someone in cc with the below email.

 mailx -s "shell script completed successfully" arun@gmail.com  < /dev/null

On most systems, it would be:

mailx -s "shell script completed successfully" -c cc1@addr.com -c cc2@addr.com arun@gmail.com  < /dev/null

to send it to arun with copies to cc1 and cc2.

What does man mailx show as a SYNOPSIS on your system?

thanks a lot don.

 mailx [-FUm] [-s subject] [-r address] [-h number] address ...
    Receive mode:
      mailx -e
      mailx [-UHLiNn] [-u user]
      mailx -f [-UHLiNn] [filename]
    Obsolescent:
      mailx [-f filename] [-UHLiNn]

Hello ramkumar15,

You can use following command for same.

cat - Input_file <<EOF | /usr/sbin/sendmail -oi -t
From: ravinder.singh@balle_balle.com
To: ravinder.singh@balle_balle.com
cc: ram_kumar15@balle_balle.com
Subject: Test_sending_email_check
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
EOF

Thanks,
R. Singh

For a proper MIME Header, a blank link is needed before the 'EOF' marker.

Also, your input may need to be sanitized, such as removing singleton ".". See the man sendmail (linux) manpage for useful options, including -i Do not strip a leading dot from lines in incoming messages, and do not treat a dot on a line by itself as the end of an incoming message. This should be set if you are reading data from a file.