Reputation: 60179
I'd like to send plain text emails from a Rails app. In my mail sending config I have:
ActionMailer::Base.default_content_type = 'text/plain'
Nonetheless, when I send a test email from the Rails console, I get:
>> GeneralAppMailer.deliver_test
# ...
Content-Type: text/html; charset=utf-8
And looking at it in Gmail, it does seem to be handled as HTML.
Upvotes: 6
Views: 7489
Reputation: 176562
Be sure your template ends with .text.erb
extension and not .html.erb
.
See ActionMailer documentation.
Upvotes: 15
Reputation: 81142
Without seeing the test
method in your GeneralAppMailer
class, it's impossible to say, but it's probably because you're rendering an HTML-based view template to send the message. But maybe you should post your code.
Upvotes: 1