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, 2019 in Linux Administration by ffdfd
• 5,550 points
1,209 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, 2019 by ajs3033
• 7,300 points

Related Questions In Linux Administration

0 votes
0 answers

How to attach a file using mail command on Linux?

I'm on a server running a Linux ...READ MORE

Apr 26, 2022 in Linux Administration by Edureka
• 13,690 points
828 views
0 votes
1 answer

How to change the default shell in Linux?

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

answered May 24, 2019 in Linux Administration by Upasana
• 8,620 points
982 views
0 votes
0 answers

Shell: How to call one shell script from another shell script?

I have two shell scripts, a.sh and ...READ MORE

Apr 14, 2022 in Linux Administration by Soham
• 9,710 points
512 views
0 votes
0 answers

Send private message to Discord user using bash and linux AT command

I'm running a Discord bot written in ...READ MORE

Apr 25, 2022 in Linux Administration by Edureka
• 13,690 points
1,201 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, 2019 in Linux Administration by Upasana
• 8,620 points
2,827 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
6,175 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,390 points
5,508 views
0 votes
2 answers

How do I use a shell script to SSH in to a remote machine to execute commands?

Sorry in advance for any formatting. Check out ...READ MORE

answered Feb 7, 2021 in Linux Administration by anonymous
17,258 views
0 votes
2 answers

how to loop through the content of a file using bash

#!/bin/bash for i in  `cat peptides.txt` do echo $i done READ MORE

answered Sep 5, 2020 in Linux Administration by Prakash K. Aithal
2,934 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP