In a current project I need to send email messages with the subject
containing national characters.
The program will be compiled to MacOSX, Windows and Linux. Development is
done under MacOSX (PPC, G4).
 
After having made a lot of tests with the German national characters ü
(ASCII dec 129) ö (ASCII dec 148) ä (ASCII dec 132) (...ÜÖÄß) in the mail
subject, I have only got one successfull test displaying the correct mail
subject. This was a test sending (My Prog) and receiving (Apple Mail) on
MacOSX. But no test displayed the correct mail subject on a different
platform.
 
My question: how can I send a correct email subject and what I'm doing
wrong.
 
Code snippet:
 
Dim mail as EmailMessage
mail.headers.appendHeader "X-Mailer", "REALbasic SMTP"
mail.Headers.AppendHeader "Mime-Version", "1.0"
mail.headers.AppendHeader "Content-type", "text/html; charset=ISO-8859-1;
format=flowed"
mail.headers.AppendHeader "Content-Transfer-Encoding", "quoted-printable"
mail.bodyHTML = fldHTMLBody.Text
 
code for test 1:
mail.Subject = ConvertEncoding(fldSubject.Text, Encodings.ISOLatin1)
// several tests have been made with varying encodings including UTF8, 
// which, this is my understanding, is the default encoding of a Textfield
in RB.
 
code for test 2:
mail.Subject = ConvertEncoding(fldSubject.Text, Encodings.ISOLatin1)
mail.Subject = EncodeQuotedPrintable(mail.Subject)
 
Displaying the complete mail message for "code for test 2" will show
following:
 
 
Subject: Gesamtstatus Gr=FCn - =E4=F6=FC=C4=D6=DC=DF
X-Mailer: REALbasic SMTP
Content-Transfer-Encoding: quoted-printable
Content-type: text/html; charset=ISO-8859-1; format=flowed
 
<HTML>
<HEAD>
</HEAD>
<BODY bgcolor="#FFFFFF" link="#FF0000" vlink="#525252" alink="#000000">
<CENTER>&uuml &auml &ouml
</BODY>
</HTML>
.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to