alternative for mailx

hi i am struggling with mailx command,

my command is

mailx -a attachment.txt -s "hi this is subject " my_name@domain.com

(Interrupt -- one more to kill letter)

the control doesn't comes out automatically, i have to press CTRL + C .. why is it happening so ?

What does "-a" do?

Normally you pipe the text of the message in as stdin.

Attachments are normally encoded using uuencode.