Mail gem - how to clean up the body string

前端 未结 4 1863
失恋的感觉
失恋的感觉 2021-02-05 19:06

I\'m trying to read an email using ruby mail gem. But mail.body.decoded returns me not just the body message. How can I clean up this body message and remove unwan

4条回答
  •  感情败类
    2021-02-05 19:34

    looks like you've got a multipart email, so you can use mail.parts[0].body.decoded These will probably come in handy too: mail.multipart?
    mail.parts.length

    The gem documentation at github is pretty decent

提交回复
热议问题