I want to send an email from a Linux Shell script. What is the standard command to do this and do I need to set up any special server names?
Linux – Sending a mail from a linux shell script
emaillinuxsendmailshell
Related Topic
- Regex – How to validate an email address using a regular expression
- Linux – How to prompt for Yes/No/Cancel input in a Linux shell script
- How to use SSH to run a local shell script on a remote machine
- How to mkdir only if a directory does not already exist
- Bash – In the shell, what does ” 2>&1 ” mean
- Bash – YYYY-MM-DD format date in shell script
- Linux – How to change permissions for a folder and its subfolders/files in one step
- Linux – How to find all files containing specific text on Linux
Best Answer
If the server is well configured, eg it has an up and running MTA, you can just use the mail command.
For instance, to send the content of a file, you can do this:
man mail
for more details.