Archive For 7. March 2016

JavaMail API – Reading emails from googlemail

By |

JavaMail API – Reading emails from googlemail

This example shows you how to use the javax.mail API to read emails from a googlemail account: Note: To run the example change the values for user and password. import javax.mail.*; import java.util.Properties; import java.util.stream.Stream; public class MailReceiver { public static void main(String[] args) throws Exception { String host = “imap.gmail.com”; String user = “your.name@gmail.com”;…

Read more »