Hey there! I know it’s been a month since my last post, I’m sorry about that but I’ve been pretty busy this days, having a lot to do at work and also being a full time student, so anyway, this time I’m sharing with you a nifty tip regarding notifications using mailx on UNIX, so without further ado, here’s the actual code:
#!/bin/ksh
#
# mailx settings:
#
to="someone@somewhere.com"
subject="[Notification] Something happened."
body="Lorem ipsum dolor sit amet et cétera."
#
# run and notify:
#
runSomething && (echo $body | mailx -s "$subject" "$to")
I hope you find it interesting, thanks much for reading and don’t hesitate to leave a comment!









thanks for the knowledge. One question, though: is this service capable of routing mail through an offshore host, like msn, for instance?
I’m sure there’s a config file somewhere but, after installing mailx, I can’t seem to locate it. I’m running Linux kernel 2.6.23 on an ubuntu distro, btw.
Thanks – great info for a newbie for myself and it worked great after I substituted bash for ksh