I am trying to run a bash to send emails from my linux server. I am using the following command:
echo "This is the message body" | mail -s "This is the subject line" -a "From: <Sender>" -a "To: <recipient>" -S smtp="smtp.gmail.com:587" -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp-auth-user=$SMTP_USER -S smtp-auth-password=$SMTP_PASS <recipient_email_address>
I am receiving the error: mail: unrecognized option '-S'
As far as I read, previously mailx was used but this error shouldn't occur with mail command. can you please help me where I am going wrong?
System Info: Ubuntu 20.04.5 LTS (GNU/Linux 5.15.0-1040-azure x86_64)
mail --version
>> mail (GNU Mailutils) 3.7
mail --version
.man mail
show you the-S
flag as an option? What does it tell you about it?