Blog Archive for January 28, 2010

Sending Email from Java

January 28, 2010

Here's an example of code to send email from Java.

import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
/**
  * A simple email sender class.
  */
public class Test
{
  /**
    * Main method to send a message given on the command line.
    */
  public static void main( …