簡體   English   中英

如何從郵遞員欄桿和身體中獲取主題

[英]how to get subject, from and body from mailman rails

我有這樣的代碼

Mailman::Application.run do
  to 'email@local.com' do
     ## how to get subject, from and body in here
  end
end

如何從主題中的電子郵件中獲取主題,內容和內容?

使用郵件gem https://github.com/mikel/mail/

Mailman::Application.run do
  default do
    mail = Mail.new(message)
    from = message.from.first
    content = mail.parts[1].body.decoded
    subject = message.subject
    //your other code

  end
end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM