The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 08-07-2008
abovais abovais is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 14
Arrow

Joeyg,

you can send both text and attachment with mailx.....
but the problem arises when you use the html text, the attached file get distorted...
like i m trying to send the mail using the following code:


Code:
echo "mail body" > tempfile
uuencode try.sh try.sh >> tempfile | mailx -s "Hi - This
is mail subject" user@domain.com < tempfile
Now if try the following code everything goes fine even in this case but the attachment contents get distorted and it can NOT be read (the attachment seems to get encoded)..

Code:
(
echo "MIME-Version: 1.0"
echo "Content-Type: mutipart/mixed;"
echo ' boundary="PAA08673.1018277622/server.domain.com"'
echo ""
echo "This is a MIME-encapsulated message"
echo ""
echo "--PAA08673.1018277622/server.domain.com"
echo "Content-Type: text/html"
echo ""
echo "<HTML>
<BODY bgcolor=red>
<blockquote>
<p><font color=black>Please find the attached report.</font></p><p> <font color=blue>Message by someone</font></p><p> <font color=blue>Body</font></p></blockquote>
</body>
</html>"
echo "--PAA08673.1018277622/server.domain.com"
) > temp

uuencode just.doc just.doc >> temp | mailx -s "Subject here" user@domain.com < temp

Please solve this error!