Thx a lot. It's now working.

I have adapted my code to 

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"
sSubject = "=?iso-8859-1?Q?" + _
   EncodeQuotedPrintable(ConvertEncoding(fldSubject.text,
Encodings.ISOLatin1)) + _
   "?="
mail.Headers.AppendHeader "Subject", sSubject

And all platforms are sending correct and readable email subjects.

I think, this is an issue for RB to implement a working email subject,
because the EmailMessage.Subject is only working with US-ASCII encoding,
even if you explicitly are using character encoding before using
EmailMessage.Subject to add a subject header entry to the mail header.

Once again, thx,
Markus

-----Original Message-----
From: Þór Sigurðsson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 26, 2006 12:21 PM
To: 'REALbasic NUG'
Subject: RE: EmailMessage and encoding (national special characters)

No.

You should MIME encode it, not just QP encode it.

This is a valid Latin1 Subject: header:

Subject: =?iso-8859-1?Q?Sta=F0a_reiknings?=

( Reads: Staða_reiknings )

The easy way:

Take the header you already created ( excluding "Subject: " ) and do
myheader = "Subject: =?iso-8859-1?Q?"+mysubject+"?="

Or thereabout.

/Þór

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:realbasic- 
> [EMAIL PROTECTED] On Behalf Of MINIHOLD Markus
> Sent: 26. september 2006 07:23
> To: [email protected]
> Subject: EmailMessage and encoding (national special characters)
> 
> 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>


_______________________________________________
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>
_______________________________________________
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