How to send mail using linux shell script?

0 votes
Is there any command I can use to send email using a linux shell script? Or do I have to use some special server or something?
Jun 11 in Linux Administration by Atul
• 5,530 points
46 views

1 answer to this question.

0 votes

If you've already configured the server, with MTA running on it you can just use the mail command.

Lets say you have a file whose content you wan to send in a mail, You can do this:

$ cat /path/to/file | mail -s "your subject" your@email.com

for more information use:

man mail
answered Jun 11 by ajs3033
• 7,280 points

Related Questions In Linux Administration

0 votes
1 answer

How to change the default shell in Linux?

1. Change the password file directly for ...READ MORE

answered May 24 in Linux Administration by Upasana
• 8,550 points
38 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3 in Linux Administration by Omkar
• 67,660 points
121 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31 in Linux Administration by Omkar
• 67,660 points
44 views
0 votes
1 answer

How to create a symlink in Linux?

To create a symbolic link, you can ...READ MORE

answered Jan 31 in Linux Administration by Omkar
• 67,660 points
77 views
0 votes
1 answer
0 votes
1 answer

To attach a file using mail command on Linux

$ echo | mutt -a syslogs.tar.gz admin@domain.org READ MORE

answered Jun 28 in Linux Administration by Upasana
• 8,550 points
188 views
+1 vote
2 answers

Execute Pig Script from Grunt Shell

From your current directory run  pig -x local Then ...READ MORE

answered Oct 25, 2018 in Big Data Hadoop by Kunal
965 views
0 votes
1 answer

How to stop messages from being displayed on spark console?

In your log4j.properties file you need to ...READ MORE

answered Apr 24, 2018 in Apache Spark by kurt_cobain
• 9,260 points
1,354 views
0 votes
1 answer
0 votes
1 answer

how to loop through the content of a file using bash

One of the ways to do it ...READ MORE

answered Feb 15 in Linux Administration by ajs3033
• 7,280 points
95 views