How can I send a mail with a compressed file as an attachment?

zip file1.zip file1|mailx –s “subject” Recepients email id

 Email content

 EOF

Category: Shell Scripting Interview Questions.