How to change mime type to text/html in rails 3?
Rails 3 defaults to Conten开发者_高级运维t-Type: text/plain
I'm trying to send and HTML email. How do I adjust the mime type?
Just adding .html
before the extension of your view template should work.
app/views/user_mailer/welcome_email.html.erb
I assume you're talking about ActionMailer? Name your view files like this:
app/views/mailer_name/method_name.text.plain.erb
app/views/mailer_name/method_name.text.html.erb
Then, in text.plain, have a plain-text version of your HTML email.
精彩评论