Tuesday, April 07, 2009

Email from Unix server with attachment and message body

I followed this article "Creating email with a text message and an attachment from standard UNIX" to test the email, however for some reason, I am not successful, may be my OS is Sun Solaris. What the article described is AIX.

I tried the following script, found that I got what I want. unix_attachment.lst file appeared as an attachment and the content of message.txt appeared in the email body.




#!/bin/ksh
# uuencode the attachment file
uuencode unix_attachment.lst unix_attachment.lst | mailx -s "Message with Attachment -Hello

`cat message.txt`
" denis@email.com

No comments: