user-avatar
Today is Tuesday
December 3, 2024

Tag: unix

August 8, 2011

How to use mail command to mail the contents of the file to somebody

by viggy — Categories: FOSS, linux, programming, shell, tech — Tags: , , Leave a comment

$cat “Filename” | mail -s “subject” “mailid”

The assumption here is that you have sendmail configured in the system and the mailid that you have provided accepts mails from unknown addresses. Gmail doesnt.