in reply to attach with unix mail

As far as I know, mailx can't do this. To swing this post back On-Topic I will recommend the module Mime::Lite. You could use this to write your own mail tool that accepts to/subject/body/attachment as parameters.
Jason