Ruby 'mikel / mail' response to the field

I am parsing the email using the style below

message = Mail.new(body)   #where body is the RAW source from the email server
message.subject #=> the subject of the message as a string
message.from #=> shows who the email is from

How do I get the value of the reply-to field, if it exists? Can a stone do this?

+3
source share
1 answer

You need a method reply_to:

message.reply_to
# => ["user@example.com"]

If no response has been set, it will be nil:

message.reply_to
# => nil

I would recommend looking at the RDoc documentation specifically for the Message Object . This will show you all the methods available in your instance message.

+9
source

All Articles