Repository navigation
Open
Description
I am doing this way
require 'gmail'
USERNAME = 'xxx'
PWD = 'xxx'
gmail = Gmail.new(USERNAME, PWD)
gmail.inbox.emails.count
# 7394
gmail.inbox.emails.last
=> <#Message:70327319034880 mailbox=inbox uid=9818>
gmail.inbox.emails.last.message
=> #<Mail::Message:70327319519480, Multipart: true, Headers: <Return-Path: <3pKNdWQgTCzMcd-gTeanPRRdjcih.VddVaT.RdbclaXj.QdcXdVbPXa.Rdb@gaia.bounces.google.com>>, <Received: by 10.28.223.9 with SMTP id w9csp1538501wmg; Wed, 5 Jul 2017 19:42:45 -0700 (PDT)>, <Received: from mail-pg0-x245.google.com (mail-pg0-x245.google.com. [2607:f8b0:400e:c05::245]) by mx.google.com with ESMTPS id o27si405612pli.602.2017.07.05.19.42.44 for <nwliu.bonio@gmail.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 19:42:45 -0700 (PDT)>, <Received: by mail-pg0-x245.google.com with SMTP id z1so6207408pgs.10 for <nwliu.bonio@gmail.com>; Wed, 05 Jul 2017 19:42:44 -0700 (PDT)>, <Date: Thu, 06 Jul 2017 02:42:40 +0000>, <From: Google <no-reply@accounts.google.com>>, <To: nwliu.bonio@gmail.com>, <Message-ID: <RINmyh7zHjhFN-0HCGcSFg@notifications.google.com>>, <Subject: =?UTF-8?B?5bey5ZWf55So5a6J5YWo5oCn6LyD5L2O55qE5oeJ55So56iL5byP5a2Y5Y+W5qyK?=>, <Mime-Version: 1.0>, <Content-Type: multipart/alternative; boundary="94eb2c13fab041830a05539d12b1">, <Delivered-To: nwliu.bonio@gmail.com>, <X-Received: by 10.99.168.5 with SMTP id o5mr8840927pgf.207.1499308965091; Wed, 05 Jul 2017 19:42:45 -0700 (PDT)>, <ARC-Seal: i=1; a=rsa-sha256; t=1499308965; cv=none; d=google.com; s=arc-20160816; b=N9DVXsaM9TeDXane6vYKW+PqtcqM14XXg2l1fyxqTOEbFU75vDgjSOLl+owgRoLQtd jG7NsfIJDdRlTIANErF6P3bbrS2vYZ2LluCOZsb9PQ3QcTov+HXPLVo6OJBUKs3zH/s0 R4RyvEUJgxh3f4wgIyAfE34tzlAjnety974dKcTLgaWpLMl/dRJRC9e2CZ0Iynkrk+Ct 9o1YfAh7ZFCvVoXxsa4jWgGVfuYkjNhlj90TESJClpJa4YscFNr5AZiXkMuUOyD+imJb EO0abA8GqmJ4wyfc+0OHcWmCBTorvKYDB7V6xo8yodIfzlnB7U8Gia5u4Pgj4g6br7zw W5Kw==>, <ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:feedback-id:date:mime-version :dkim-signature:arc-authentication-results; bh=J8tuWNX9MU59+l6fzokgEdFYDHN6NqIS4Z5md7SzPv8=; b=aWj9kKK81awzTiDEcm8tW8T5hWrsKkOwsk0EBjmH4IrBKBjzX2KC5MDOKO7e7qzsx0It seems the message is unreadable, how do I extract the content, sender and more information?
Metadata
Metadata
Assignees
Labels
No labels
Activity
altruby commentedon Jul 6, 2017
try
message.partsand check out the documentation for the "mail" gem, the object returned by the message method is from that gem.