Mutt and Mail both commands are similarly and very powerful to send an email from the system,
Mutt : It's a Mail User Agent, small but powerful and highly comfortable for Mail client in Unix/Linux operating system. Also support color terminal, threaded sorting, MIME, POP3 and IMAP.
Can send a message to multiple users on a single command,
Install mutt package by yum command
# yum install mutt
or
Download mutt from below URL and install it.
http://www.mutt.org/download.html
Send Simple Mail:
echo ""Type Email content"" | mutt -s "Subject of Email" -- username@thelinuxfaq.com
Send Mail with Attachment:
echo "Type Email content" | mutt -a "/root/report.txt" -s "Subject of Email" -- username@thelinuxfaq.com
or
mutt -s "Test email" someone@somedomain.com -a file.txt < MessageBody
Mail send to Multiple User:
echo "Type Email content" | mutt -a "/root/report.txt" -s "Subject of Email" -- username@domainname.com mynameis@gmail.com
Mail : To send a message to multiple users on a single command , mail can be invoked with message details
Install Mail:
# yum install mailx
Send Simple Mail:
mail -s "xxx" to_address@hostname.com
or
echo "Type your body content" | mail -s "Mail subject" toemail@hostname.com
Mail with Cc:
Also send a message with carbon copy(Cc). Once typed the command : mail -s "test email from server" toemail@hostname.com press enter then type your message content and press CTRL + D, it will ask Cc:
mail -s "test email from server" toemailid@hostname.com
type message content
Cc: user@hostname.com
Send Message with Attachment:
mail -s "Subject Name " toemail@hostname.com < body.txt
or
(uuencode /root/userssys.txt; echo "Type Body of Message ") | mail -s 'Message Subjects' toemail@hostname.com
To send multiple user just give a space type another Email Id's.
Comments (0)