加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – ruby??’mikel / mail’回复字段

发布时间:2020-12-17 03:53:51 所属栏目:百科 来源:网络整理
导读:我正在使用以下样式解析电子邮件 message = Mail.new(body) #where body is the RAW source from the email servermessage.subject #= the subject of the message as a stringmessage.from #= shows who the email is from 如果存在,我如何获得’reply-to’
我正在使用以下样式解析电子邮件

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

如果存在,我如何获得’reply-to’字段的值?宝石可以这样做吗?

解决方法

你想要reply_to方法:

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

如果没有回复集,它将是零:

message.reply_to
# => nil

我建议查看RDoc documentation,特别是Message object.这将显示您的消息实例上可用的所有方法.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读