This has gone far beyond the syntax error in post #1 and your requirement is changing.
I do not understand your most recent post.
If you are trying to spoof the source address or supply an email display name I don't know how to do this with "mailx". When sending from "mailx" the exact sender email address which will be seen in the mail reader depends on how your "sendmail" is configured, the unix account name of the sender and whether that account name is "Trusted" in the sendmail configuration. There are inbuilt safegurds to prevent forged mail.
Other correspondants may know?
---------- Post updated at 13:26 ---------- Previous update was at 13:16 ----------
At you now seem to have switched to using "sendmail" direct this is a whole new ballgame. I was disturbed that you posted the same sort of erroneous "mailx" commands that started this thread.
https://www.unix.com/unix-advanced-ex...l-problem.html
Might be a good time to sit down and document your requirement?