Send Mail with attachements from Linux Command Line

Send Mail with attachements from Linux Command Line

Simpler way of mailing attachments:

$ mail -s “subject” user@gmail.com -A /root/attachment-file.txt < /root/message-file.txt

On Ubuntu:

#apt-get install mutt postfix -y

Choose default options during installation

#mutt -a <attachment file>

Type Senders Mail ID –> Give Subject of Mail –> Type any Message –> Press Ctrl+x

Click “y” to send mail.

Other Way Just for Messaging:

#apt-get install mailutils -y

$ mail -s “Hello World” someone@example.com

$ mail -s “Hello World” someone@example.com
Cc: Hi Peter
How are you I am fine Good Bye
<Ctrl+D>

Advertisements

2 thoughts on “Send Mail with attachements from Linux Command Line

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s