HighDots Forums  

Sending Mails with mutations ä,ü,ö

Ruby On Rails Talk Ruby On Rails programming language mailing list


Discuss Sending Mails with mutations ä,ü,ö in the Ruby On Rails Talk forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Adam Meyer
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 12:25 PM






T. N.t. wrote:
Quote:
Adam Meyer wrote:
T. N.t. wrote:
Adam Meyer wrote:
hmm... but its not only in the subject. its in body too.

I don't know what @body[:url] is, but for

part :content_type => "text/plain",
:body => render_message("invoice.html.erb", body)

you probably should say :content_type => 'text/plain; charset=utf-8'

T.

@body[:url] is just a value I want to use in the email template.
Your solution might work in the body, but what is with the subject?

As I already wrote:

@subject = "=?utf-8?Q?#{[@subject].pack("M").chomp}?="

Didn't you try it?

T.

I don't know what is happening in you code, but it works.
Thanks!

--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #12  
Old   
T. N.t.
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 02:12 PM






Adam Meyer wrote:
Quote:
I don't know what is happening in you code, but it works.
Thanks!
Honestly, I also don't understand this pack command, but what happens
is, that it encodes the string as quoted-printable. In

=?utf-8?Q?string?=

utf-8 is obviously the charset/encoding, Q is the way the bytes are
represented with 7-bit characters, which is quoted-printable (Q) or
base64 (B) and then comes obviously the string. So instead of that
cryptic ['string'].pack("M").chomp you could also do

"=?utf-8?B?#{Base64.b64encode(@subject).chomp}?="

But quoted-printable is more adequate for european texts.

T.
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.