Re: JavaMail/JMTA help request
Re: JavaMail/JMTA help request
- Subject: Re: JavaMail/JMTA help request
- From: Chuck Hill <email@hidden>
- Date: Tue, 26 Oct 2004 12:53:20 -0700
Project Wonder includes a wrapper framework for this. You will probably be
a lot happier if you just use that. The JavaMail API is NOT pretty!
Chuck
At 03:48 PM 26/10/2004 -0400, Nathan Dumar wrote:
>Would someone please help me get javamail working? I've read
>everything I can find about all of it (which for JMTA is next to
>nothing). The code I have so far is:
>
>import javax.mail.*;
>import javax.mail.internet.*;
>import javax.mail.Session;
>import java.util.*;
>import alt.dev.jmta.*;
>
>public class STMailer {
>
> public static void sendSTMessage(String from, String to, String
>subject, String body) {
> Properties props = new Properties();
> Session session = Session.getInstance(props);
> try {
> Message aMessage = new MimeMessage(session);
> aMessage.setFrom(new InternetAddress(from));
> aMessage.addRecipient(Message.RecipientType.TO, new
>InternetAddress(to));
> aMessage.setSubject(subject);
> aMessage.setText(body);
> // according to JMTA doc, following line should send message
> JMTA.send(aMessage); // this is line 27 that the error references
> } catch (MessagingException mex) { System.out.println(mex); }
> return;
> }
>}
>
>This code spits out the following error:
>com.webobjects.foundation.NSForwardException for
>java.lang.NoClassDefFoundError: javax/mail/Transport
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
> at
>java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> at STMailer.sendSTMessage(STMailer.java:27)
> at Main.sendMessage(Main.java:122)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAcces
>sor.java:54)
> at
>com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(
>NSKeyValueCoding.java:1160)
> at
>com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueFo
>rKey(NSKeyValueCoding.java:1268)
> at
>com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1539)
> at
>com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValu
>eCoding.java:498)
>...
>
>
>Thank you,
>Nathan
>
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>Webobjects-dev mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
e.net
>
>This email sent to email@hidden
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden