How to send html formated messages through E-mail?


#1

Hi,

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
message.
How to avoid it? & how to send html message through my application?

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

Thanx
Pras


#2

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 = account.email
@from = ‘removed_email_address@domain.invalid’
@body[‘account’] = account
content_type “text/html” <–
end

hope it works for you,
micheldogger