Gmail-API JAVA Client Send Email Insufficient Permission

◇◆丶佛笑我妖孽 提交于 2019-12-04 10:11:50

Need to delete C:\Users\user.credentials Because I run for many times. For first times, I did not grant the full right.

Yster

If you take a look at this answer. It should answer your question. I cannot post the answer here because it is illegal to post a duplicate. This worked for me. Found this after a long time of searching. Let me know if it worked for you too. https://stackoverflow.com/a/39639526/1317559

Delete C:\Users\user.credentials and change your scopes according to what you need.

SCOPES = Arrays.asList(GmailScopes.GMAIL_LABELS, GmailScopes.GMAIL_INSERT, GmailScopes.MAIL_GOOGLE_COM);

Change the SCOPE from SheetsScopes.SPREADSHEETS_READONLY to SheetsScopes.SPREADSHEETS.

private static final List SCOPES = Arrays.asList(SheetsScopes.SPREADSHEETS);

//private static final List<String> SCOPES = Arrays.asList(SheetsScopes.SPREADSHEETS_READONLY);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!