Skip to content

Instantly share code, notes, and snippets.

@uid0
Created January 4, 2012 18:29
Show Gist options
  • Save uid0/1561361 to your computer and use it in GitHub Desktop.
Save uid0/1561361 to your computer and use it in GitHub Desktop.

Revisions

  1. uid0 created this gist Jan 4, 2012.
    23 changes: 23 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@

    import org.apache.commons.mail.*;

    public class EmailTest {
    /**
    * @param args
    */
    public static void main(String[] args) {
    System.out.println("Attempting to send email");
    Email email = new SimpleEmail();

    try {
    email.setHostName("10.2.1.9");
    email.addTo("[email protected]_doesntwork");
    email.setFrom("[email protected]");
    email.setMsg("This is a bounce test email, number one.");
    email.send();
    } catch (EmailException e) {
    System.out.println("Unable to Send Email");
    }

    }
    }