mail.jar

i want to test apache soap samples; i've installed apache, jdk, apache soap and i've always a problem with mail.jar (java.lang.NoClassDefFoundError: javax/mail/MessagingException)
[188 byte] By [soumayaa] at [2007-11-26 19:02:18]
# 1
Should like the jar might not be in the class path for your application? Make sure the jar with that class is in your classpath.
zadoka at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...
# 2
yes i did so
soumayaa at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...
# 3
> yes i did soWell, some how it can't be found. Based on the limited information I have about your problem. All I can suggest is to double-check it.
zadoka at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...
# 4

hi forum

i have new in java mail so i have already downloaded the javamail api in c drive and already unzip also in c drive so the problem is i want to set classpath of mail.jar file but where it is i can't able to find in the api please suggest me whole process to run simple java mail program

thanks

abhinay_31a at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...
# 5
You should add the library activation.jar to your class path.Download it from http://java.sun.com/products/javabeans/glasgow/jaf.htmlHope That Helps
java_2006a at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...
# 6

to run any java mail program i have already set following classpath

.;C:\Apps\Java\javamail-1.2\mail.jar;C:\Apps\Java

\javamail-1.2\mailapi.jar;C:\Apps\Java\javamail-1.2

\pop3.jar;C:\Apps\Java\javamail-1.2\smtp.jar;C:\Apps

\Java\jaf-1.1\activation.jar

now whenever i am going to compile any programme its showing error

package javax.activation.*; does not exist but i have already downloaded the activation.jar file and put above folder directory please tell me whats the solution for this

abhinay_31a at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...
# 7

hi forum i have problem in java mail actually i compiled this code and the problem i have how to run this code please help me if anyone knows about that

import javax.mail.Message;

import javax.mail.MessagingException;

import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeMessage;

import java.util.*;

public class MailSender {

public void postMail(String smtpsrv, String recipients[], String subject,

String message, String from) throws MessagingException {

boolean debug = false;

//Set the host smtp address

Properties props = new Properties();

props.put("mail.smtp.host", smtpsrv);

// create some properties and get the default Session

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

session.setDebug(debug);

// create a message

Message msg = new MimeMessage(session);

// set the from and to address

InternetAddress addressFrom = new InternetAddress(from);

msg.setFrom(addressFrom);

InternetAddress addressTo[]= new InternetAddress[recipients.length];

addressTo= new InternetAddress[recipients.length];

for (int i = 0; i < recipients.length; i++)

{

addressTo= new InternetAddress(recipients);

}

msg.setRecipients(Message.RecipientType.TO,addressTo);

// Setting the Subject and Content Type

msg.setSubject(subject);

msg.setContent(message, "text/html;charset=utf-8");

Transport.send(msg);

}

}

abhinay_31a at 2007-7-9 20:48:02 > top of Java-index,Desktop,Deploying...