Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: java email program

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post java email program

    plz tell me step by step working of email sending program
    i have compiled the program bur whaen executing the same i get the following error

    D:\javamail-1.4.4\demo>java msgsend -o from@address -M SMTP.Server to@address
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Message
    Caused by: java.lang.ClassNotFoundException: javax.mail.Message
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: msgsend. Program will exit.
    I DONT KNOW WHAT IS THE PROBLEM MAY CONFIGURING SMTP SERVER PLZ TELL ME


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: java email program

    Hello ashwidjava.

    Welcome to the Java Programming Forums.

    I suggest you Google the exception.

    NoClassDefFoundError (Java Platform SE 6)

    Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
    So this suggests that no definition of the class could be found. It is caused by javax.mail.Message

    Have you imported the JavaMail API into your project correctly?

    JavaMail API Download
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

Similar Threads

  1. JSP Email Attachments
    By DNisbet in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: November 9th, 2012, 02:16 PM
  2. email reader
    By rk.kavuri in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: March 4th, 2011, 03:59 AM
  3. JSP Email Attachments
    By DNisbet in forum Member Introductions
    Replies: 0
    Last Post: January 18th, 2011, 09:20 AM
  4. Java problem -- sending email via JSP page
    By java_beginner in forum Java Theory & Questions
    Replies: 2
    Last Post: June 28th, 2010, 02:35 AM
  5. Images not going in email
    By anjali09s in forum Java SE APIs
    Replies: 3
    Last Post: August 2nd, 2009, 06:06 PM