How do I send email from a Sun System (use mailx)? Sun: Solaris FAQ#!/bin/sh## Purpose: Demonstrate how to send an email from UNIX using mailx.############################################################# Example 1 - Simple: echo "This is the body."| mailx - s "mailx Test. Example 2 - Using Variables: SUBJECT="mailx Test. EMAIL_ADDRESS="jsmith@abc. BODY="This is the body of the message."echo "$BODY" | mailx - s "$SUBJECT" "$EMAIL_ADDRESS"# Example 3 - Attached File: SUBJECT="mailx Test. EMAIL_ADDRESS="jsmith@abc. BODY="This is the body of the message."ATTACHED_FILE="/etc/hosts"cat "$ATTACHED_FILE" | mailx - s "$SUBJECT" "$EMAIL_ADDRESS"# Example 4 - Attached File to Windows Email: SUBJECT="mailx Test. EMAIL_ADDRESS="jsmith@abc. BODY="This is the body of the message."ATTACHED_FILE_DIR="/etc/"ATTACHED_FILE="hosts"ATTACHED_FILE_AS="hosts. ATTACHED_FILE_DIR$ATTACHED_FILE" > /tmp/"$ATTACHED_FILE_AS"uuencode /tmp/"$ATTACHED_FILE_AS" /tmp/"$ATTACHED_FILE_AS" | mailx - s "$SUBJECT" "$EMAIL_ADDRESS"rm /tmp/"$ATTACHED_FILE_AS". Welcome to the home of Oracle Solaris open source projects on java.net! This project will be a hub to provide developer information and resources for the open source.
![]() Understanding the SOLARIS file system is very important, before we discuss anything further. Its huge topic and I suggest you really need to be patient while going. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2016
Categories |