This is accomplished in a similar way to the Attachments example in the HowToSendEmailsWithActionMailer document. You must first get a reference to a TMail object by calling the dynamic <code>create_xxxxx</code> method instead of the <code>deliver_xxxxx</code> method.

Once you have the reference, you can use the <code>set_content_type method</code>. For example:

<pre><code>email = Mailer.create_my_mail(params)
email.set_content_type("text/html")
Mailer.deliver(email)</code></pre>

h2. Updated Instructions for Edge Rails

As of patch "1388":http://dev.rubyonrails.com/changeset/1382, you can now set the content_type in the method itself:

<pre><code>
class SignupNotifier < ActionMailer::Base
  def signup_notification(user)
    recipients = user.email
    from = 'webmaster@example.com'
    subject = "Welcome!"
    body :name => user.login
    content_type "text/html"
  end
end
</code></pre>

category:Howto
