Sample Header Ad - 728x90

mail: unrecognized option '-S' | sending mail from linux server

0 votes
1 answer
892 views
I am trying to run a bash to send emails from my linux server. I am using the following command:
"This is the message body" | mail -s "This is the subject line" -a "From: " -a "To: " -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
I am receiving the error:
: 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)
--version
>> mail (GNU Mailutils) 3.7
Asked by user3165121 (1 rep)
Sep 14, 2023, 08:12 AM
Last activity: Sep 15, 2023, 10:05 AM