What is the easiest way to send and receive mails in java.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
JavaMail is the traditional answer for sending email (as everyone's pointing out).
As you also want to receive mail, however, you should check out Apache James. It's a modular mail server and heavily configurable. It'll talk POP and IMAP, supports custom plugins and can be embedded in your application (if you so wish).
Check this package out. From the link, here's a code sample:
Don't forget Jakarta Commons Email for sending mail. It has a very easy to use API.