I am using AngularJs front-end and PHP backend, utilizing the Gmail api client, to send and view emails. I am able to successfully send emails with attachments using the method shown here. But I am getting an "Error 413: Request Entity Too Large" when the message size is over 5MB.
I have looked at a question that is identical to mine. The answer provided allows files to be uploaded to Google Drive. I am unsure on how to refer to the Google Drive files in associated email messages.
According to documentation using Google Drive files as attachments is only necessary after the total size of the email exceeds 35MB.
The document also states that emails with large attachments can be sent using the media /upload option. But I am not able to find a php client method that would allow me to do so.
Summing up, I have 2 questions. How is the media /upload method used to send emails with large attachments. How can files on Google Drive be referred to in email messages?