I want to use Gmail within my website to send and receive mails. How can i Achieve that?

笑着哭i 提交于 2020-01-07 09:32:57

问题


I am having a website written in JAVA SPRING and HIBERNATE. I want to integrate gmail as apart of my website where my logged in users can use their gmail within my website. How can i do this?

Is there any way to create any mail server instead using gmail?

Anyway my aim is to send and receive mails within the logged in users, it will be helpful if that is achieved by gmail coz everything is cool there.


回答1:


In order to do that, you need to follow the documentation for OAUTH2 at google.

https://developers.google.com/gmail/xoauth2_protocol

Once you have access to their account, you can send and receive mail on their behalf. Getting users to grant you access to their accounts will be a challenge.




回答2:


The JavaMail FAQ has instructions for using Gmail.




回答3:


Since you have mentioned Spring, I assume you need a Spring bean that can send emails from within your project.

Check this - http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mail.html



来源:https://stackoverflow.com/questions/38159384/i-want-to-use-gmail-within-my-website-to-send-and-receive-mails-how-can-i-achie

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