4

我正在使用以下样式解析电子邮件

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

如果存在“回复”字段,我将如何获得它的值?宝石能做到吗?

4

1 回答 1

10

你想要的reply_to方法:

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

如果没有设置回复,它将为零:

message.reply_to
# => nil

我建议查看RDoc 文档,特别是Message 对象。这将向您显示您的message实例上可用的所有方法。

于 2012-04-11T23:08:50.603 回答