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
  #1  
Old   
Adam Meyer
 
Posts: n/a

Default Sending Mails with mutations ä,ü,ö - 11-04-2009 , 05:28 PM






Hi everyone

I am sending mails with rails in German. The Problem is that the German
letters ä,ü,ö are arriving correctly at the receiver.

When the subject contains the word

Für

the receiver gets

Für

Does anybody knows this issue?

Thanks in advance.

Adam
--
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
  #2  
Old   
T. N.t.
 
Posts: n/a

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






Adam Meyer wrote:
Quote:
Hi everyone

I am sending mails with rails in German. The Problem is that the German
letters ä,ü,ö are arriving correctly at the receiver.

When the subject contains the word

Für

the receiver gets

Für

Does anybody knows this issue?
This is strange. ActionMailer (or is it TMail?) should encode this
correctly like =?utf-8?Q?=C3=84=C3=96=C3=9C?= (this is ÄÖÜ). For me it
does it very well. What version do you use and what is your code?

Regards, 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
  #3  
Old   
Adam Meyer
 
Posts: n/a

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



T. N.t. wrote:
Quote:
Adam Meyer wrote:
Hi everyone

I am sending mails with rails in German. The Problem is that the German
letters ä,ü,ö are arriving correctly at the receiver.

When the subject contains the word

Für

the receiver gets

Für

Does anybody knows this issue?

This is strange. ActionMailer (or is it TMail?) should encode this
correctly like =?utf-8?Q?=C3=84=C3=96=C3=9C?= (this is ÄÖÜ). For me it
does it very well. What version do you use and what is your code?

Regards, T.
I am riding on 2.2.2 with Actionmailer and my code is

def invoice(kwiker, url, name)
setup_email(kwiker)
@subject += 'Rechnung für Bestellung bei kwikit.de Grusskarten'
@body[:url] = "http://#{APP_CONFIG['site_host']}/"

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

attachment :content_type => "application/pdf",
:body => File.read(url),
:filename => name
end

and this is in my production.rb

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
--
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
  #4  
Old   
T. N.t.
 
Posts: n/a

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



Adam Meyer wrote:
Quote:
...
I am riding on 2.2.2 with Actionmailer and my code is
I have 2.3.4; maybe it's a new feature that the headers are quoted
automatically.

For now you could do it by hand. Somewhere in the TMail module must be
the function to make RFC 2231 headers. I can't find it now. So a
temporary solution was:

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

A more advanced function would break longer strings into multiple lines.

Hope this helps, 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
  #5  
Old   
Adam Meyer
 
Posts: n/a

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



T. N.t. wrote:
Quote:
Adam Meyer wrote:
...
I am riding on 2.2.2 with Actionmailer and my code is

I have 2.3.4; maybe it's a new feature that the headers are quoted
automatically.

For now you could do it by hand. Somewhere in the TMail module must be
the function to make RFC 2231 headers. I can't find it now. So a
temporary solution was:

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

A more advanced function would break longer strings into multiple lines.

Hope this helps, T.

hmm... but its not only in the subject. its in body too.

I am scared to update my rails, I dont want my app to break down
completely.
--
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
  #6  
Old   
Colin Law
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 04:11 AM



2009/11/5 Adam Meyer <rails-mailing-list (AT) andreas-s (DOT) net>:
Quote:
T. N.t. wrote:
Adam Meyer wrote:
...
I am riding on 2.2.2 with Actionmailer and my code is

I have 2.3.4; maybe it's a new feature that the headers are quoted
automatically.

For now you could do it by hand. Somewhere in the TMail module must be
the function to make RFC 2231 headers. I can't find it now. So a
temporary solution was:

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

A more advanced function would break longer strings into multiple lines.

Hope this helps, T.


hmm... but its not only in the subject. its in body too.

I am scared to update my rails, I dont want my app to break down
completely.
You should not be scared to try an update, specify version 2.2.2 in
environment.rb (or freeze 2.2.2 into the app), install the later
version of rails and modify your app on a branch in your version
control system (I prefer git) so you can experiment without affecting
your working code. Then when all is working on the branch simply
merge it into the trunk.

Colin
Colin

--~--~---------~--~----~------------~-------~--~----~
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
  #7  
Old   
T. N.t.
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 04:57 AM



Adam Meyer wrote:
Quote:
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.
--
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
  #8  
Old   
Adam Meyer
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 04:58 AM



T. N.t. wrote:
Quote:
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?
--
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
  #9  
Old   
T. N.t.
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 06:39 AM



Adam Meyer wrote:
Quote:
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.
--
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
  #10  
Old   
Marnen Laibow-Koser
 
Posts: n/a

Default Re: Sending Mails with mutations ä,ü,ö - 11-05-2009 , 08:04 AM



Adam Meyer wrote:
[...]
Quote:
I am scared to update my rails, I dont want my app to break down
completely.
That's why you have comprehensive automated tests! Just make sure that
all tests pass after you upgrade.

(You *do* have tests, right? If not, write some right away.)

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen (AT) marnen (DOT) org
--
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.