How can I send an email by Java application using GMail, Yahoo, or Hotmail?
First download the JavaMail API and make sure the relevant jar files are in your classpath. Here’s a full working example using GMail. import java.util.*; import javax.mail.*; import javax.mail.internet.*; public class Main { private static String USER_NAME = “*****”; // GMail user name (just the part before “@gmail.com”) private static String PASSWORD = “********”; // … Read more