overview.html revision 809
4e10d188042815c5285edf00ea96896b862e0863aurium<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
4e10d188042815c5285edf00ea96896b862e0863aurium DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4e10d188042815c5285edf00ea96896b862e0863aurium Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
4e10d188042815c5285edf00ea96896b862e0863aurium The contents of this file are subject to the terms of either the GNU
4e10d188042815c5285edf00ea96896b862e0863aurium General Public License Version 2 only ("GPL") or the Common Development
4e10d188042815c5285edf00ea96896b862e0863aurium and Distribution License("CDDL") (collectively, the "License"). You
4e10d188042815c5285edf00ea96896b862e0863aurium may not use this file except in compliance with the License. You can
4e10d188042815c5285edf00ea96896b862e0863aurium obtain a copy of the License at
4e10d188042815c5285edf00ea96896b862e0863aurium https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
4e10d188042815c5285edf00ea96896b862e0863aurium or packager/legal/LICENSE.txt. See the License for the specific
4e10d188042815c5285edf00ea96896b862e0863aurium language governing permissions and limitations under the License.
4e10d188042815c5285edf00ea96896b862e0863aurium When distributing the software, include this License Header Notice in each
4e10d188042815c5285edf00ea96896b862e0863aurium file and include the License file at packager/legal/LICENSE.txt.
4e10d188042815c5285edf00ea96896b862e0863aurium GPL Classpath Exception:
4e10d188042815c5285edf00ea96896b862e0863aurium Oracle designates this particular file as subject to the "Classpath"
4e10d188042815c5285edf00ea96896b862e0863aurium exception as provided by Oracle in the GPL Version 2 section of the License
4e10d188042815c5285edf00ea96896b862e0863aurium file that accompanied this code.
4e10d188042815c5285edf00ea96896b862e0863aurium Modifications:
83aaf46c9feab529aeb9add871c05c3d1177afccaurium If applicable, add the following below the License Header, with the fields
83aaf46c9feab529aeb9add871c05c3d1177afccaurium enclosed by brackets [] replaced by your own identifying information:
83aaf46c9feab529aeb9add871c05c3d1177afccaurium "Portions Copyright [year] [name of copyright owner]"
4e10d188042815c5285edf00ea96896b862e0863aurium Contributor(s):
83aaf46c9feab529aeb9add871c05c3d1177afccaurium If you wish your version of this file to be governed by only the CDDL or
83aaf46c9feab529aeb9add871c05c3d1177afccaurium only the GPL Version 2, indicate your decision by adding "[Contributor]
83aaf46c9feab529aeb9add871c05c3d1177afccaurium elects to include this software in this distribution under the [CDDL or GPL
4e10d188042815c5285edf00ea96896b862e0863aurium Version 2] license." If you don't indicate a single choice of license, a
83aaf46c9feab529aeb9add871c05c3d1177afccaurium recipient has the option to distribute your version of this file under
4e10d188042815c5285edf00ea96896b862e0863aurium either the CDDL, the GPL Version 2 or to extend the choice of license to
4e10d188042815c5285edf00ea96896b862e0863aurium its licensees as provided above. However, if you add GPL Version 2 code
83aaf46c9feab529aeb9add871c05c3d1177afccaurium and therefore, elected the GPL Version 2 license, then the option applies
83aaf46c9feab529aeb9add871c05c3d1177afccaurium only if the new code is made subject to such option by the copyright
4e10d188042815c5285edf00ea96896b862e0863auriumprovides classes that model a mail system.
4e10d188042815c5285edf00ea96896b862e0863auriumThe <code>javax.mail</code> package defines classes that are common to
4e10d188042815c5285edf00ea96896b862e0863auriumall mail systems.
83aaf46c9feab529aeb9add871c05c3d1177afccauriumThe <code>javax.mail.internet</code> package defines classes that are specific
83aaf46c9feab529aeb9add871c05c3d1177afccauriumto mail systems based on internet standards such as MIME, SMTP, POP3, and IMAP.
4b20bf95123c697a0635b14433d183b02d8b8781auriumThe JavaMail API includes the <code>javax.mail</code> package and subpackages.
83aaf46c9feab529aeb9add871c05c3d1177afccauriumFor an overview of the JavaMail API, read the
83aaf46c9feab529aeb9add871c05c3d1177afccaurium<A HREF="http://javamail.java.net/nonav/docs/JavaMail-1.5.pdf" TARGET="_top">
83aaf46c9feab529aeb9add871c05c3d1177afccauriumJavaMail specification</A>.
83aaf46c9feab529aeb9add871c05c3d1177afccauriumThe code to send a plain text message can be as simple as the following:
05c0670a5ec29b57709b1a0bd01010d120a76d8dAlex Valavanis Properties props = new Properties();
05c0670a5ec29b57709b1a0bd01010d120a76d8dAlex Valavanis props.put("mail.smtp.host", "my-mail-server");
05c0670a5ec29b57709b1a0bd01010d120a76d8dAlex Valavanis Session session = Session.getInstance(props, null);
msg.setFrom("me@example.com");
msg.setSubject("JavaMail hello world example");
msg.setSentDate(new Date());
msg.setText("Hello, world!\n");
Transport.send(msg, "me@example.com", "my-password");
System.out.println("send failed, exception: " + mex);
specified type (e.g., "rfc822" for standard internet addresses).
Controls the scope of events. (See the javax.mail.event package.)
Executor.execute method is used to run the event dispatcher
see the {@link javax.mail.internet} package documentation
and {@link com.sun.mail.smtp SMTP} packages provide details.