uuencode file.zip file.zip | mail -s "testfile" mailadd@group.com
Error is - mail: illegal option -- s
If i use mailx then I can specify subject but it truncates null char at the end of line which i dont want. and data is in message body and not as an attachment.
There's no "-s" switch to "mail" in mainstream unix.
What unix version is the o/p using?
What software produced the ".zip" file and was that software run on the unix server itself, or was the file copied from a Windows platform?
Is the mail engine "sendmail"?
Here is a method to mail the file as an attachment with unix sendmail. I've tested the method with a file compressed with unix "compress", mailed the file as an attachment, saved the attachment and checked with unix checksum "cksum".
(
echo "From: `uname -n` ${LOGNAME}"
echo "Subject: Mail Test from `uname -n` `date`"
# The next line appears as the message body
echo "Zip file attached"
# The next line creates the attachment with a suitable extension
uuencode file.zip file.zip
echo "."
) | /usr/lib/sendmail mailadd@group.com
Hi,
This works perfectly.
Thanks you so much for your help.
Regards,
Bhushan
---------- Post updated 09-21-09 at 12:08 AM ---------- Previous update was 09-20-09 at 11:39 PM ----------
Hi methyl,
One more small help needed. I am using your code and its working perfectly. However I could not see to email address specified in email, after I receive email in my mailbox. From email address and subject/attachement/body all are visible.
Regards,
---------- Post updated at 12:14 AM ---------- Previous update was at 12:08 AM ----------
Got it......I changed as below -
(
echo "From: `uname -n` "
echo "Subject: Mail Test from `uname -n` `date`"
echo "To: abc@abc.com"
# The next line appears as the message body
echo "Zip file attached"
# The next line creates the attachment with a suitable extension
uuencode bank_Listing1.zip bank_Listing1.zip
echo "."
) | /usr/lib/sendmail -vt