Need some Help? Have a tip to share?

Email me at MacTipper@gmail.com, or, leave a comment!

Learn How to Win Free Stuff Online


10/11/09

Send Email - With Body - From the Command Line

I mentioned a short time ago about sending emails from the command line. However, in the context of sending emails from scripts, you could only send the subject line of an email. I recently discovered that it is possible to send a scripted email message with both a subject and a body. The code is:

echo "This is mail body" | mail -s "This is subject" example@example.com


While the recipient will not be able to reply to the message, this is a quick and easy way of getting notifications sent to you when something happens, or doesn't happen when it should.

0 comments:

Post a Comment

Subscribe Via Email!

Enter your email address:

Delivered by FeedBurner