send automatic email

I need to be able to send an email message with the output of a command (ifconfig) to be exact.  How can I send this with out cutting and pasting the output.  i would like something like "mail address@somewhere.com output of command".. Is this possible??
meetzeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
n0thingConnect With a Mentor Commented:
mail -s "Output of ifconfig" abc@somewhere.com < ifconfig -a
0
 
ozoCommented:
ifconfig -a | mail -s "Output of ifconfig" abc@somewhere.com
0
All Courses

From novice to tech pro — start learning today.