above syntax did not through any error...but when i see my email..it does not have an attachment in it and body of my email having some unwanted characters..
seems uuencode proplem..not able to understand ..since its quite urgent..to make correction in my script as well..
/usr/lib/sendmail -t -i <<EOF
To: emailid.test@email.com
Subject: Here is some
Some messagetext ex. $(date)
or some file like:
$(cat message.txt)
$(uuencode some.gif some.gif )
EOF
No, it's only example - some textfile including some text = message body. Attachment is some binary file.
Previous only example how nice method HERE is to make ex. mail template.
/usr/lib/sendmail -t -i <<EOF
To: emailid.test@email.com
Subject: Here is some
$(uuencode some.some some.some )
EOF
/usr/lib/sendmail -t -i <<EOF
To: emailid.test@email.com
Subject: Here is some
Some body text and attachment also.
$(uuencode some.zip some.zip )
EOF
Try it, easy to see result.
You need only sendmail binary - somewhere = give the path
and shell ex. bash, ksh, dash, ... Operating system - select some.
If you have old Bourne Shell, nothing else, then you must write command substitution using old format
$( cmd ) => ` cmd `
/usr/lib/sendmail -t -i <<EOF
To: emailid.test@email.com
Subject: Here is some
`uuencode some.some some.some `
EOF