简体   繁体   中英

Java web application- How to send email through the same server?

I have a java web application system. In the system, there are a number of users. For example, there are 10 different users in the system.

Each user have the feature to send a email to the other users within the same system. From what I read,it seems Java Mail API is an option but it's for sending to email client server instead.

What I want is when the recipient user logs in to the account, he should be able to view the email within that system.

Can anyone give me some suggestion or what to look at to achieve this?

One possible solution to implement an in-application messaging system could look like this:

You create a table for your messages. That table could have columns like message id, recipient (eg email adress) and content.

When a user creates a message, you store that in the new table.

When another user logs in, you make a query on that table, if there are any messages for that user (which have the users adress in the recipient column), and show those messages to the user. Additionally, when creating the message, you can create an event which could trigger then a push notification. There are several 3rd party providers, where you can just call an API, and the user would get a notification on his phone (you would need then at least a phone number or other identifiers for that user).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM