How to send big attachments with gmail API

陌路散爱 提交于 2019-11-29 18:09:15

Well gmail has a file size limit try uploading to the Google drive and share that

In case anyone else is facing same problem. I solved my problem. There was bug in my program. I was passing encoded $mime to media constructor. It should be pass un-encoded mime. Overall changes were following to make it working.

  1. Removed $msg->setRaw($mime); this line.
  2. Passed un-decoded $mime to media constructor.
  3. Passed un-decoded mime size to this line $media->setFileSize(strlen($mime));

And it worked!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!