[Seaside] emails with diacritics and apple Mail and outlook andwindows mail

Holger Kleinsorgen h.kleinsorgen at i-views.de
Fri Feb 11 14:09:58 UTC 2011


see RFC 2045

the following works with MS Outlook & Thunderbird.
my first attempt to send mail with Squeak, so there might be an 
easier/sharper solution:

| message |
message  := MailMessage empty.
message setField: 'subject' toString: (((GRCodec forEncoding: 'utf-8') 
encode: 'Encoding test €€€')).
message setField: 'from' toString: 'h.kleinsorgen at i-views.de'.
message setField: 'to' toString: 'h.kleinsorgen at i-views.de'.
message setField: 'content-type' toString: 'text/plain;charset=utf-8'.
message body: (MIMEDocument content: ((GRCodec forEncoding: 'utf-8') 
encode: 'Motörhead €' )).
SMTPClient deliverMailFrom: message from to: (Array with: message to) 
text: message asSendableText usingServer: 'mail'.


> I'm connecting directly to the SMTP and after the session opens I send
> what comes from this:
>
> plainMessage
> ^String streamContents: [ :stream |
>
> self
> renderAddress: self from
> withHeader: 'From: '
> on: stream.
>
> self to do: [ :each |
> self
> renderAddress: each
> withHeader: 'To: '
> on: stream ].
>
> self cc do: [ :each |
> self
> renderAddress: each
> withHeader: 'Cc: '
> on: stream ].
>
> self bcc do: [ :each |
> self
> renderAddress: each
> withHeader: 'Bcc: '
> on: stream ].
> stream
> nextPutAll: 'Subject: ';
> nextPutAll: self subject greaseString toUtf8.
>
> self body isNil ifFalse: [|content|
> content := self body greaseString toUtf8.
> self isHtml ifFalse:[
> content := Character cr asString, Character cr asString, content].
> stream nextPutAll: content ] ]
>
>
>
>
> On Feb 11, 2011, at 4:47 AM, Philippe Marschall wrote:
>
>  > 2011/2/11 Sebastian Sastre <sebastian at flowingconcept.com>:
>  >> hey guys,
>  >> I'm experiencing some email-encoding issues
>  >> the thing is we use utf-8 so text can have diacritics and everything is
>  >> pretty much okay except for outlook and windows mail
>  >> if any of you guys is using diacritics and you can receive those well in
>  >> Apple Mail and outlook and windows mail can you please share how do you
>  >> build the mail? (header and encoding stuff)
>  >


More information about the seaside mailing list