Forum: Ruby on Rails How to get email body in plain/text

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Anatol P. (Guest)
on 2006-01-28 16:44
(Received via mailing list)
Hi, all.

I have a very simple Mailer class
class AliasMailer < ActionMailer::Base
  def receive(email)
    puts email.body
  end
end

And I have problem here with TMail::Mail object that I received via
receive() function.
I am trying to get body of the mail but I have following text

Hello\r\n\r\n--\r\n\r\n\r\nHello<br clear=\"all\"><br>-- <br>h

for mail that have in body just word Hello. It means that TMail::Mail
object
returns body both as plain-text and html text.
But I need only first one. What is right answer on my question??

I have sent mail from Google account that I believe sends it as html.
But
anyway in Mailer I need text as plain text.
This topic is locked and can not be replied to.