1

I'm trying to insert a message in a Gmail inbox using the Google Api for Javascript (14.0.0). When there is not any attachment it works fine, but when I try an email with a large attachment (~20MB), I've found that the response depends on the account where I'm inserting the message. This is the code which inserts the message:

gmail.users.messages.insert({
    userId: this.googleId,
    uploadType: 'resumable',
    internalDateSource: 'dateHeader',
    resource: message,
    auth: this.auth_client
})

For some accounts this works good, but for another ones with the same attachment I get the following error:

<HEAD>
<TITLE>Request Entity Too Large</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Request Entity Too Large</H1>
<H2>Error 413</H2>
</BODY>
</HTML>

In the past, I used the uploadType as multipart and this error appeared always, but now with resumable only for some accounts, even testing them with e-mails with the same size.

I have compare both account configurations and they seem pretty similar.

Is there some configuration I am missing?

csuarez
  • 11
  • 3
  • 1
    Possible duplicate of [413 - Request Entity Too Large](http://stackoverflow.com/questions/24462184/413-request-entity-too-large) – DaImTo Oct 11 '16 at 09:45
  • @DaImTo check the edit, I think that I am describing a different thing – csuarez Oct 11 '16 at 11:04
  • I agree with DalmTo, you need to use the media upload when sending/inserting large messages (over 5MB IIRC). – Eric D Oct 11 '16 at 15:54

0 Answers0