Just curious Matt,
What part of OpenBD are you circumventing - by using OpenBD to test JavaMail - outside OpenBD? Does this just avoid the data in the xml config, or also skip some of the other jars as well?
IOW if this test works, what is not working?

Alan Holden
(at work)


On 3/28/2012 9:26 PM, Matthew Woodward wrote:
On Wed, Mar 28, 2012 at 1:58 PM, Alan Cole <[email protected] <mailto:[email protected]>> wrote:

    How would I test the use of "JavaMail"?


Just replace "your.mail.server" and the email addresses in the example below.

<cfscript language="java" jarlist="mail.jar">
        import java.util.*;
        import javax.mail.*;
        import javax.mail.internet.*;

Properties props = new Properties(); // Properties props = System.getProperties();
        props.put("mail.smtp.host", "your.mail.server");

        Session session = Session.getDefaultInstance(props, null);

        Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("[email protected] <mailto:[email protected]>")); msg.addRecipient(Message.RecipientType.TO <http://Message.RecipientType.TO>, new InternetAddress("[email protected] <mailto:[email protected]>"));
        msg.setSubject("Test from JavaMail");
        msg.setContent("This is the message body", "text/plain");

        Transport.send(msg);
</cfscript>
--
Matthew Woodward
[email protected] <mailto:[email protected]>
http://blog.mattwoodward.com
identi.ca <http://identi.ca> / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html
--
online documentation: http://openbd.org/manual/
google+ hints/tips: https://plus.google.com/115990347459711259462
http://groups.google.com/group/openbd?hl=en

--
online documentation: http://openbd.org/manual/
  google+ hints/tips: https://plus.google.com/115990347459711259462
    http://groups.google.com/group/openbd?hl=en

Reply via email to