Mailx help in Solaris

Hi Team,

We are with Solaris 10. And presently we are sending mail using the tool mailx -s. Our requirement is we need to send amil with HIGHPRIORITY. SO is there any way to send the mail as HIGHPRIORITY.

If not any alternative way instaead of using mailx.

Thanks in advance.
Regards
Bala

Use sendmail instead:

{
        echo "From: from@addr.com"
        echo "To: to@addr.com"
        echo "MIME-Version: 1.0"
        echo "Content-Type: text/plain"
        echo "Subject: Your Subject"
        echo "Importance:High"
        # Email body here
} | /usr/sbin/sendmail -t
1 Like

Hi Yoda,

Thanks for the reply, Is the mailx is not wothfull to send a mail as high priority.
Ok, Actually i am new to UNIX environment. can i run this script directly from the commnaline? Or need to place this code in sh?

Please update me.

Regards
Bala

I would recommend to run it as a script.

Just make sure you run it as a group command { list; } like posted.

By the way I checked the SunOS mailx manual and I do not see any option that support this feature.

1 Like

ok. Thanks Yoda. There is any chance to run this multi lines in a single command line..

If there share me.

Thanks in advance
Bala

Yes, put commands in single line separated by semi-colon ;

{ echo "To: to@addr.com";echo "MIME-Version: 1.0";echo "Content-Type: text/plain";echo "Subject: Subject";echo "Importance:High";echo "Hello"; } | /usr/sbin/sendmail -t
1 Like

Ok Yoda,

Will check and update the sam.

Thanks,

Regards
Bala

Hi Yoda,

I have researched on mailx utility. There is a option to send the mail as High priority. I had and succeeded. THe code i have used as below

echo <mail content> | mailx -s <subject> <mailid> -a "Importance:High"

Thanks

Regards
Bala