Forum: Ruby on Rails How to send html formated messages through E-mail?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Prashant T. (Guest)
on 2006-06-09 10:47

I want to send mail trough my rails application. Currently I am able to
send messages with content-type="text/plain". But when I am trying to
send messages in html format, the recepient receives messages but it's
in the plain text format with heml tags also gets displayed in ythe
How to avoid it? & how to send html message through my application?

Please help me.(I am using Actionmailer for sending mails...)

Michel D. (Guest)
on 2006-06-09 11:10
Most likely you need the following line, in your method
in the ActionMailer (models)

content_type  "text/html"

for example:

  def activate(account)
    @subject          = 'Subject'
    @recipients       =
    @from             = 'removed_email_address@domain.invalid'
    @body['account']  = account
    content_type  "text/html"                     <--

hope it works for you,
This topic is locked and can not be replied to.