Use mutt or mail in different contexts - Linux or Unix

Hi All,
I need to write a "portable" shell script that can send mail from Unix or Linux servers.

In my server Linux I find mutt and I need to attach a file

In my server Unix mutt is not present. Only mail/mailx. In this case for attaching a file I need to pipe the uuecode command.

My question.... Is it true this situation?

In this case I need to check with uname command if the script shell is running on Linux or Unix environment.

Any suggestion will be well appreciated.

Thanks in advance for your kind support.

Regards,

Giovanni

It's possible for UNIX and Linux servers to have mutt, mail, both, or neither. Even if present, they may not be operating. Not all servers are mail servers, after all...

Check for the existence of the commands instead of what kind of UNIX/Linux.