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

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.
1c46e952a61c99d9eae4f21037a088fd?d=identicon&s=25 Anatol Pomozov (Guest)
on 2006-01-28 15:44
(Received via mailing list)
Hi, all.

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

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
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.
anyway in Mailer I need text as plain text.
This topic is locked and can not be replied to.