MAILX: to send mail out from Linux cmd with attachment.


1. create a file under your user profile with contents below:
$ vi /home/user1/.mailrc

Contents:
account admin {
set from="admin@serverA.com"
set smtp=192.168.1.1:25
}

2. run from cmd
$ echo "test mail content" | mail -A admin -a file.jpg -s "test mail" abc@abc.com"

No comments: