title: ruby mail gem - set charset in deliver block
body: <p>I'm using the mail gem to send E-Mail with UTF-8 content using this code</p>
  
  <pre><code>Mail.defaults do
      ...
  end
  
  Mail.deliver do
      from    "user@example.com"
      to      "otheruser@example.com"
      subject "Mäbülö..."
      body    "Märchenbücher lösen Leseschwächen."
  end
  </code></pre>
  
  <p>This works, but gives the warning</p>
  
  <pre><code>Non US-ASCII detected and no charset defined.
  Defaulting to UTF-8, set your own if this is incorrect.
  </code></pre>
  
  <p>Now after much trying around, consulting mail gem's generated documentation as well as source code, I'm still unable to set the charset. There is a method <code>charset=</code> in Message.rb, but when I add a call to charset, like so:</p>
  
  <pre><code>Mail.deliver do
      from    "user@example.com"
      to      "otheruser@example.com"
      charset "UTF-8"
      subject "Mäbülö..."
      body    "Märchenbücher lösen Leseschwächen."
  end
  </code></pre>
  
  <p>I get this ArgumentError:</p>
  
  <pre><code>/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:1423:in `charset': wrong number of arguments (1 for 0) (ArgumentError)
  </code></pre>
  
  <p>How can I set the charset within the deliver block?</p>