error using Javamail, help me urgently

I am trying to run a simple mail sender program, but getting the following errors, pls help me...

package com.lotontech.mail;

import javax.mail.*;

import javax.mail.internet.*;

import java.util.*;

import javax.mail.Message;

/**

* A simple email sender class.

*/

public class SimpleSender

{

/**

* Main method to send a message given on the command line.

*/

public static void main(String args[])

{

try

{

String smtpServer=args[0];

String to=args[1];

String from=args[2];

String subject=args[3];

String body=args[4];

send(smtpServer, to, from, subject, body);

}

catch (Exception ex)

{

System.out.println("Usage: java com.lotontech.mail.SimpleSender"

+" smtpServer toAddress fromAddress subjectText bodyText");

}

System.exit(0);

}

/**

* "send" method to send the message.

*/

public static void send(String smtpServer, String to, String from

, String subject, String body)

{

try

{

Properties props = System.getProperties();

// -- Attaching to default Session, or we could start a new one --

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

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

// -- Create a new message --

Message msg = new MimeMessage(session);

// -- Set the FROM and TO fields --

msg.setFrom(new InternetAddress(from));

msg.setRecipients(Message.RecipientType.TO,

InternetAddress.parse(to, false));

// -- We could include CC recipients too --

// if (cc != null)

// msg.setRecipients(Message.RecipientType.CC

// ,InternetAddress.parse(cc, false));

// -- Set the subject and body text --

msg.setSubject(subject);

msg.setText(body);

// -- Set some other header information --

msg.setHeader("X-Mailer", "LOTONtechEmail");

msg.setSentDate(new Date());

// -- Send the message --

Transport.send(msg);

System.out.println("Message sent OK.");

}

catch (Exception ex)

{

ex.printStackTrace();

}

}

}

Errors--

java.lang.UnsupportedClassVersionError: javax/mail/Message (Unsupported major.minor version 48.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:703)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:133)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:320)

at java.net.URLClassLoader.access$400(URLClassLoader.java:93)

at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:678)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:239)

at java.lang.ClassLoader.loadClass(ClassLoader.java:516)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:460)

at java.lang.ClassLoader.loadClass(ClassLoader.java:448)

Exception in thread "main"

[3162 byte] By [sameer004a] at [2007-11-26 20:34:15]
# 1
Which JDK/JRE are you using? What does your classpath look like, make sure you are not using any old jar files with newer JDK.
satishva at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
I am usink jdk 1.3
sameer004a at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Hmm. What is your classpath? How did you get javamail jars?
satishva at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
i am using WSAD, so added the classpath using the 'Add External Jars' property. I am using javamail-1.4
sameer004a at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
JavaMail 1.4 requires at least JDK 1.4. If you're stuck with JDK 1.3,use JavaMail 1.3.3.
bshannona at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6

Thanks, I got rid of those errors, but now I am facing the following errors. I am in a corporate network ! Wht should I do now ?

javax.mail.SendFailedException: Sending failed;

nested exception is:

class javax.mail.MessagingException: Could not connect to SMTP host: inmumm02.tcs.com, port: 25

at javax.mail.Transport.send0(Transport.java:218)

at javax.mail.Transport.send(Transport.java:80)

at com.lotontech.mail.SimpleSender.send(SimpleSender.java:75)

at com.lotontech.mail.SimpleSender.main(SimpleSender.java:36)

sameer004a at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7

Can you do

telnet inmumm02.tcs.com 25

If not - you may be behind a firewall or outgoing smtp may be disable in your corporate network.

Another approach is to use the your corporate SMTP Server.

Are you doing this program for work or personal use? If you are doing for work, then should not you be able to use your work/corporate SMTP server and you must able to access it.

If you are using it for personal use, you better run this at somewhere else and use the ISP's SMTP server.

Hope that helps.

thanks

Satish

satishva at 2007-7-10 1:25:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...