Showing results for 
Search instead for 
Did you mean: 

mail with German special characters and attachments

Paul Randall_1
Occasional Contributor

mail with German special characters and attachments

I have found this message group very helpful with a batch mailing solution I am developing. I am 98% there and need some advice on the remaining items. The requirements: pdf and text file attachments, variable from addresses, German special characters in both the subject and the body.

Started off with ELM, found attachments (with the [include ...] syntax worked fine. Problem with specifying the return addresses dynamically.

Switched to mailx e.g. syntax:
(cat body_file; uuencode pdf_file) | mailx -m -s "\"$l_subject\"" -r $l_returnaddress $l_emailaddress
Attachments sent OK to most mail systems. Problem with German characters. Setting charset=ISO-8859-1 worked with German in the subject but not with German in the body.

I finally tried coding the MIME command directly and sending it to sendmail e.g.

echo To: $EMAIL_TO
echo Subject: $EMAIL_SUBJECT
echo 'MIME-Version: 1.0'
echo 'Content-type: Multipart/Mixed ; charset=ISO-8859-1; boundary="xxxxyyyzzqzzyyyxxxx"'
echo '--xxxxyyyzzqzzyyyxxxx'
echo ''
echo '--xxxxyyyzzqzzyyyxxxx'
echo 'Content-type: application/octet-stream'
echo 'Content-Transfer-Encoding: base64'
echo 'Content-Disposition: attachment; filename="'$FILE_NAME'"'
echo ''
echo '--xxxxyyyzzqzzyyyxxxx--'
} | /usr/sbin/sendmail -f $EMAIL_FROM $EMAIL_TO

This gave me a problem with pdf's coming through corrupted.

So... can anybody provide advice for any of the above problems. My preference would probably be the MIME solution as from what I have read it is a more reliable protocol than uuencode.

Pete Randall
Outstanding Contributor

Re: mail with German special characters and attachments

Sorry to say, I haven't a clue, Paul, but I thought I should say howdy!

Your long lost brother,