Hi all
I'm having trouble using MIME's multipart/mixed content type. I just try to send an email with a common body text together with an attachment (.gif). The only output I get is an empty email with no text and an invalid attachment (MS Outlook says it doesn't recognize the attachment type). Both text body and attachment show up when sent separately (i.e. not using muiltipart/mixed) which should prove my encoding is correct.
Here is the code:
Code:
#!/usr/bin/ksh
echo "To: \"User\" <user@domain.com>" > mailtest
echo "Subject: Testing attachments" >> mailtest
echo "MIME-Version: 1.0" >> mailtest
echo "From: \"My Test\" <bass@europolitan.se>" >> mailtest
echo "Content-Type: multipart/mixed; boundary=\"sendfile-attachment-boundary\"" >> mailtest
echo "--sendfile-attachment-boundary" >> mailtest
echo "Content-Type: text/plain; charset=\"us-ascii\"" >> mailtest
echo "Hello how are you?" >> mailtest
echo "--sendfile-attachment-boundary" >> mailtest
echo "Content-Type: image/gif; name=\"header_logo_trans.gif\"" >> mailtest
echo "Content-Transfer-Encoding: base64" >> mailtest
echo "Content-Disposition: attachment" >> mailtest
base64-1.4/base64 -e header_logo_trans.gif >> mailtest
echo "--sendfile-attachment-boundary--" >> mailtest
cat mailtest | mail user@domain.com
exit 0
Now I just wonder if anybody on this forum could easily identify the error (if there is one

). I´ve searched for hours on the internet and found some examples but it mostly tended to say my above code was correct...
Many thanks,
Yann
PS: I first searched for an answer in the FAQ and found a topic. However I didn't feel more clever having read it
