How to send a mail with attachment?

Hi,
I usually write a file TEST.MAIL like this to send mails:

Importance: High
Priority: Urgent
X-Priority: 1 (Highest)
From: user
Subject: error

... text body ....

and then I launch it (or writre a c-chell that launchs it) by writing:

mail a@b.com < /users/.../TEST.MAIL

How can I write something that allows me to send the text body and an attachment file attach.html?
Thanks in advance

Have you tried to search the answer in this forum (google unix.com). ?
There are many top�c about mail attachment.

Jean-Pierre.

Use a program like Mutt or Cleancode.org >> Projects >> email

mutt -s "Test mail" -a /path/to/attach.html recipient@domain < /users/.../TEST.MAIL

subject line (option -s)
attachment (with option -a)
main body of the e-mail (read message from the file /users/.../TEST.MAIL)

I have used the following in the past on Solaris to create a message body and add an attachment

 
(echo "BODY";uuencode filename output_filename)|mailx -s "SUBJECT" someone@mail.com