I'm trying to send an email using bash script.
I tried using the following in the bash script with no success as I execute the script it asks for CC:
#!/bin/bash
recipient="[email protected]"
mail -s "This is a test mail" "$recipient"
but nothing seems to work as I want it to be automated.
Also I want to send a message with the mail I went through different tutorials but in every tutorial a message is written in a text file then the file is sent but can't I write a message with the mail command itself and not save it to any file and send it. Please Help.
P.S.
I just want the script to do the following
If a particular operation is complete then it sends an email to the recipient with a subject and a message saying operation is completed successfully.