GmailApp tread.reply results in "unrecognized client"

69 views
Skip to first unread message

ronk...@gmail.com

unread,
Aug 26, 2022, 7:30:13 PM8/26/22
to Google Apps Script Community
Hi all,

Does anyone know if there are any differences in the headers or bodies of messages sent via GmailApp vs. the Gmail client? If so, then what are these differences?

Here's the context for my question:

I've been using GmailApp thread.reply with great success for a long-time, but am having a weird issue now. 

A third-party service provider (which I prefer not to name) sends me transactional emails that land in my Gmail inbox. When I hit reply in the Gmail client, the service provider has no issues accepting my replies. 

However, when I'm using thread.reply() to auto-respond to these messages, the provider sends me a response it can't accept my reply because I may be using an email client that this provider doesn't support. 

I tried to research this error and couldn't find anything meaningful. I will try to contact the provider for clarifications, but I was wondering if you knew what could be different in the message headers or in the body of GmailApp vs the Gmail client.

My code is simply:

  const thread = GmailApp.getThreadById(threadId);
  const body = 'hello';
  thread.reply(body);



Thank you,
Ben

Ben Ronkin

unread,
Aug 28, 2022, 3:15:04 AM8/28/22
to Google Apps Script Community
Just to follow up on my question: When I compare the message headers from the Gmail client and the GmailApp, I see two differences:

Difference #1:

The GmailApp contains this header::

"Received: from 229...329 named unknown by gmailapi.google.com with HTTPREST; Sat, 27 Aug 2022 23:17:15 -0700 MIME-Version: 1.0"

The Gmail client doesn't contain such a header.

Difference #2: 

The Gmail client contains this header:

Content-Transfer-Encoding: quoted-printable

The GmailApp does not contain this header:


Could either of these differences explain why a third-party service provider would state that the email from GmailApp "can't be accepted because I may be using an email client that this provider doesn't support?"

Ben
Reply all
Reply to author
Forward
0 new messages