Anybody here know any Java?

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
I'm looking for a little help on a SendMail program. If you guys can figure out what I'm doing wrong, please let me know. I'm having a heck of a time trying to figure this out.

<code>

package email;

import java.io.*;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;

public class Sender {

protected String message_recip = "AMDPwred@mediaone.net";
protected String message_subject = "Test Email";
protected String message_cc = "";
protected String message_body = "This is just a test. ";

/* JavaMail session object */
protected Session session;
/* JavaMail message object */
protected Message mesg;

public void doSend() {

Properties props = new Properties();
props.put("VA.SMTP.mediaone.net", "mailhost");

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

try {
mesg = new MimeMessage(session);
mesg.setFrom(new InternetAddress("My Email"));

InternetAddress toAddress = new InternetAddress(message_recip);
mesg.addRecipient(Message.RecipientType.TO, toAddress);

InternetAddress ccAddress = new InternetAddress(message_cc);
mesg.addRecipient(Message.RecipientType.CC, ccAddress);

mesg.setSubject(message_subject);

mesg.setText(message_body);

Transport.send(mesg);

} catch (MessagingException ex) {
while ((ex = (MessagingException)ex.getNextException()) != null) {
ex.printStackTrace();
}
}
}

public static void main(String[] av) {
int cnt = 1;
for (int i = 0; i < cnt; i++) {
Sender sm = new Sender();
sm.doSend();
}
}
}

</code>

And I get these as my errors:

C:\Program Files\JBuilder5\jdk1.3\bin\javaw -classpath "C:\Documents and Settings\Chris Stewart\jbproject\EMail\classes\email;C:\javamail-1.2\imap.jar;C:\javamail-1.2\mail.jar;C:\javamail-1.2\mailapi.jar;C:\javamail-1.2\pop3.jar;C:\javamail-1.2\smtp.jar;C:\Program Files\JBuilder5\jdk1.3\demo\jfc\Java2D\Java2Demo.jar;C:\Program Files\JBuilder5\jdk1.3\jre\lib\i18n.jar;C:\Program Files\JBuilder5\jdk1.3\jre\lib\jaws.jar;C:\Program Files\JBuilder5\jdk1.3\jre\lib\rt.jar;C:\Program Files\JBuilder5\jdk1.3\jre\lib\sunrsasign.jar;C:\Program Files\JBuilder5\jdk1.3\lib\dt.jar;C:\Program Files\JBuilder5\jdk1.3\lib\tools.jar" email.Sender


java.lang.NoClassDefFoundError: javax/activation/DataSource
at email.Sender.doSend(Sender.java:38)
at email.Sender.main(Sender.java:64)
Exception in thread "main"

Any ideas?
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
try killinging the package statement and compiling again, tell me what it says then.
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
I did and it gave:

"Sender.java": Error #: 901 : package . stated in source c:\Documents and Settings\Chris Stewart\jbproject\EMail\src\email\Sender.java does not match directory email

BTW, I'm using JBuilder 5.
 

bluerpk

Member
May 31, 2001
97
0
0
I believe you need a activation package for your java mail to work. I this this can be found in the java.sun.com web site. Get the jar file, place it in your classpath and try again. Hopefully that should work.
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
I downloaded the newest version of JavaMail (Dec 2000 I think it was) and added all of the jar files to my classpath.
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0


<< I believe you need a activation package for your java mail to work. I this this can be found in the java.sun.com web site. Get the jar file, place it in your classpath and try again. Hopefully that should work. >>



Oh ok, I see what you mean. Let me try that quick.
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
Good catch bud, that did the trick. I'm not getting the email though but that's a problem with my SMTP settings and all I think. Thanks for your help!
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
I'm having some trouble sending out the email now. Do you guys know if my SMTP is correct (the structure of it)? I know the VA.mediaone.net part is, because it's mine
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |