How to send big attachments with gmail API
i'm trying to send an email with Gmail API. I'm able to send it with smaller files successfully. Problem appears when I try to send attachment with bigger size. It's been couple of hours I'm trying different solutions. Before it was giving error Error 413: Request Entity Too Large . I updated my code and it looks like this: $mime = rtrim(strtr(base64_encode($mime), '+/', '-_'), '='); $msg = new Google_Service_Gmail_Message(); $msg->setRaw($mime); $sendOptions = [ 'uploadType' => 'resumable' ]; // size of chunks we are going to send to google $chunkSizeBytes = 1 * 1024 * 1024; $client->setDefer