Quantcast
Channel: Examples Java Code Geeks » mail
Viewing all articles
Browse latest Browse all 5

Sending emails with JavaMail

$
0
0
Sending a simple text message // Common variables String host = "your_smtp_server"; String from = "from_address"; String to = "to_address"; // Set properties Properties props = new Properties(); props.put("mail.smtp.host", host); props.put("mail.debug", "true"); // Get session Session session = Session.getInstance(props); try { // Instantiate a message Message msg = new MimeMessage(session); // Set the FROM message […]

Viewing all articles
Browse latest Browse all 5

Trending Articles