How to get email body in plain/text

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”>


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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs