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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With