简体   繁体   中英

how do you connect to your email using java (not javamail)

Is there a way to connect to your email inbox in java (using netbeans IDE) without the use of JavaMail API? I have been searching for a way to do it without the use of that API as I am trying to construct a program which reads my email and stores them into a database using sql server. is there a way?

You can use Socket classes. Send message directly.

Why not use JavaMail? There are other libraries available, such as ChilKat's - or you could talk POP3/IMAP directly, you know open a socket on port 110/143 and issue commands and read the responses (which is what the libraries will do for you).

If you have to provide a single JAR file, you can merge the JavaMail classes (and dependencies) with your own code, or - depending on your target infrastructure - a WAR or EAR might be more appropriate.

Cheers,

If you want to do this the hard way, you can write eg a POP3 client in Java yourself. Use Socket, connect to the right host and port (port is usually 110) and start issuing POP3 commands.

http://www.ietf.org/rfc/rfc1939.txt

http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html

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