Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby 'mikel/mail' reply-to field

I'm parsing an email using the below style

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 would I get a value of the 'reply-to' field if it exists? Can the gem do this?

like image 949
Tarang Avatar asked Dec 28 '22 02:12

Tarang


1 Answers

You want the reply_to method:

message.reply_to
# => ["[email protected]"]

If there was no reply-to set, it'll be nil:

message.reply_to
# => nil

I'd recommend looking through the RDoc documentation, specifically for the Message object. This will show you all of the methods available on your message instance.

like image 154
Dylan Markow Avatar answered Dec 29 '22 15:12

Dylan Markow