1

There is a group mailbox which is used by few users via delegated access. The emails that are sent from this group mailbox displays that email is from the group mailbox and sent by property shows the email address of the individual who has sent this email via delegated access.

In Google Apps Script how to get the value of the "Sent By" from the emails sent from this gmail account?

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
Partha
  • 11
  • 2

1 Answers1

1

App Script has a class for Gmail API called GmailMessage. GmailMessage class has the getFrom() method which gets the sender of the message.

snippet:

var thread = GmailApp.getInboxThreads(0,1)[0]; // get first thread in inbox
 var message = thread.getMessages()[0]; // get first message
 Logger.log(message.getFrom()); // log from address of the message
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • 1
    GmailApp and Gmail API are not the same. The first is a "basic" Google Apps Script services while the second is an "advanced" service. – Rubén Apr 14 '17 at 05:05