I found the following link online that may be the cause of the issue:
mailx sends text body as an attachment - Red Hat Customer Portal
Seems to be an issue with non-US-ASCII or non-printable characters.
Mailx expects input text to be in Unix format, with lines separated by newline (^J, \n) characters only. Non-Unix text files that use carriage return (^M, \r) characters in addition will be treated as binary data; to send such files as text, strip these characters e. g. by tr -d ’\015’ <input | mailx . . . or fix the tools that generate them.
Alternatively dos2unix can be used to strip the \r
character. Similarly, if any other non-US-ASCII or non-printable characters are present, strip or convert them before passing the text to mailx
.