Import javax.mail.* problem ...

I have added the line 'import javax.mail.*;' to the top of my program and got the compiler error 'Package javax.mail not found in import'. I have since read through loads of similar problems on this forum and have tried the following :-
Downloaded jaf-1_0_2.zip and javamail-1_3.zip from the Sun site, unzipped them, and placed mail.jar and activation.jar onto my PC. I have added these .jar files into my classpath and re-booted my PC. However, I STILL get the same compiler message and it's doing my head in! Do I somehow need to add the .jar files into my project? Or am I just being very thick? I am developing using Visual Cafe 3.0. I am using JDK 1.2.2.
I am quite new to this and I have not even started to code the e-mailing method yet - I'm simply trying to get the import working.
Any help would be much appreciated and would mean I can sleep tonight!
Thanks in advance.

Hi,
check where you have placed the mail.jar file.....give the proper classpath where you have placed the jar file....
check this out....it will compile...

Similar Messages

  • Problem importing javax.mail.*

    Hey,
    I just installed the Java JDK 6 update 16 (windows platform). I am not able to compile a sample code that used the javax.mail package. I am not able to get past the
    import javax.mail.*;
    line. The compiles says "package javax.mail does not exist"
    I tried separately installing the JavaMail 1.4.2 API and setting the classpath to the mail.jar file as suggested in the readme.txt for this API, but I still get the same problem. Anyone has any suggestions?
    Thanks!

    Hi! I see you've answered similar problems before - but nothing seems to be working for me.
    My OS is Vista. I installed the JDK 6 update 16 just yesterday. I'm using the command line javac.
    I can see the mail.jar file in this folder: C:\Sun\SDK\lib\ and I've set the classpath using : set classpath=%classpath%;C:\Sun\SDK\lib\mail.jar
    When I type set classpath at the prompt, I can see that the classpath has been set correctly.
    Please help!

  • Import javax.mail not found problem

    I have downloaded the most recent mail.jar and activation.jar files and have created a library w/in JDev called javamail and have added these jars to that library. I have also included this library in my ViewController Project. The problem I am having is that the following imports statements are not found by JDev:
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    When I open up the mail.jar I can find all of these classes, so why are these imports not being recongnized?
    I have also tried import javax.mail.*; to include everthing and this does not work either.
    Does anyone have any suggestions on how to trouble shoot this issue?

    Try to add the J2EE library - which is predefined in JDeveloper- to your project's libraries.
    Worked for me.

  • Import javax.mail package does not exists

    Hi,
    when i tried to compile the source code for email using jdk1.3.1, it compiled fine. but when i tried to compile using jdk1.4.., it had the following errors such as
    import javax.mail package does not exists,
    import javax.mail.internet package does not exists
    package javax.activation does not exist
    Is it because of the jdk version problem???
    Pls help me

    I have the same problem with javax.ejb
    Now i've downloaded and installed the j2ee and set my classpath to the j2ee.jar. I've had to make a new path cause i'm running XP.
    This doesn't work.
    to compile it in Jcreator or JBuilder I can make it work by adding this package (j2ee.jar) in the project settings - required libraries.
    But I have to do this for every project again and again.
    I can make it work but i thougt the classpath would be enough ??
    Bassegio

  • Trying to import javax.mail.*

    hi,
    I need to make a sort of webmail program for school, i understand most of the things I've read so far about it but when i actually try to program and import javax.mail.* and javax.mail.internet.* Together (the compiler we have to use) doesn't recognise these import
    any help would be appreciated because i'm dying to get started :)

    Hi,
    You need to have java mail jar files in your classpath.
    They are available for download at http://java.sun.com/products/javamail/downloads/index.html
    -Amol

  • Import javax.mail not found

    Hello,
    I am new to Java Mail. I wanted to test my first programme. When I compile, I get this errors.
    package javax.mail not found in import and so on. I have set my classpath to so
    set classpath = %classpath%;C:\j2sdk1.4.0\lib\mail.jar;C:\j2sdk1.4.0\lib\activation.jar
    I included the mail.jar,smtp.jar and activation.jar in the lib directory of my jdk e.g c:\j2sdk1.4.0\lib\ "the jar file".
    Can any one tell me what I am missing here?
    Thanks
    James

    the easiest way to do this is to put
    activation.jar
    mail.jar          
    mailapi.jar     
    imap.jar     
    smtp.jar          
    pop3.jar
    into the virtual machine directory C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext
    or the lib\ext directory of whatever virtual machine you are using
    and put coppies of them in JDK
    C:\j2sdk1.4.0-beta3\jre\lib\ext
    or jre\lib\ext
    of whatever JDK you are using
    this way they are found automaticaly
    no need for classpath

  • Javax.mail problem...can any1 help

    Hi all;
    me am using javamail version 1.3 to send simple text mail using smtp server...during compilation, no error arises but while running following exception arises;
    Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied ; nested exception is: javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied ; nested exception is: javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied
    wat should i do...where does the problem lie...
    would b waiting desperately for immediate replies.
    Regards

    while executing the above mentioned code...following errors come out...
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
         javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
         javax.mail.SendFailedException: 550 5.7.1 <[email protected]>... Relaying denied
    nested exception is:
         javax.mail.SendFailedException: 550 5.7.1 <[email protected]>... Relaying denied
    nested exception is:
         javax.mail.SendFailedException: 550 5.7.1 <[email protected]>... Relaying denied
         at javax.mail.Transport.send0(Transport.java:218)
         at javax.mail.Transport.send(Transport.java:80)
         at __27eayyaz._msgsend__jsp._jspService(/~ayyaz/msgsend.jsp:25)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
         at com.caucho.jsp.Page.subservice(Page.java:485)
         at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:181)
         at com.caucho.server.http.Invocation.service(Invocation.java:291)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:341)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:268)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
         at java.lang.Thread.run(Thread.java:544)

  • Importing javax.ejb problems

    Hi,
    I have started learning EJB using netbeans 6.5 running on a mac os X 10.5.6. When i am trying to import javax.ejb and error stating that package javax.ejb does not exist.
    From a search on the net i have learned that on windows os it is a problem of class paths. I don't know how to solve this problem on mac.
    Thanks
    Ray

    Here is what I have done recently:
    I tried it in Eclipse, which also isn't able to find javax.ejb and java.ejb
    What is going wrong? It seems like j2ee.jar doesn't provide these libraries.
    Thank you.

  • Import deleted mail problems

    Hello I have tried importing the mail that I have lost on my work computer and when I finish importing the mbox, it is empty. Does anyone have any troubleshooting ideas or do I have to accept my loss.
    Thanks

    I have 3 email accounts and 2 are working on my Macbook Pro (Lion and Mountain Lion), but one account keeps showing "offline" and I can get it to show "online".  Settings are the same as on my Air, and the Air (Lion) works fine with all three accounts.  Had everything working before doing some reinstall efforts.  Now mail is screwed up again.  (I am a Eudora lover and this isn't helping me love Mail...)

  • Import javax.swing problems

    hey
    I am new to java and have recently downloaded j2sdk1.4.2_04. I am trying to create a simple graphical application. However, It doesnt seem to import the javax.swing.* libraries. I understand that there is the src.zip in the directory, so I unzipped it but it still doesn't read the package. I read elsewhere on this forum that you should set the path to src.zip. I have tried that and it also doesnt work. My current path is:
    PATH=C:\j2sdk1.4.2_04\lib\src.zip;C:\j2sdk1.4.2_04\bin
    Is there an error in this, or what else should I try? All suggestions greatly appreciated.

    There's no need to set your classpath when importing any of the standard packages that are provided by the JDK. Perhaps you could post a (small) code sample and the compiler error you are getting.

  • Import Archived Mail problem

    I have an email Archive file about 87GB's in size.  My hard drive has only 57GB in memory left.  I have 500GB on iCloud available.  Is there a way to get the archive file straight into iCloud's Mail Archive so that I can view it in Mac Mail?

    Hi,
    check where you have placed the mail.jar file.....give the proper classpath where you have placed the jar file....
    check this out....it will compile...

  • How to solve this problem javax.mail.AuthenticationFailedException

    i was used in this progrm my labtop means working correctly but instead of labtop i am using the desktop means following error is occuered can any one tell to me how to solve this problem.The erroe is **javax.mail.AuthenticationFailedException**
    The coding is as followes
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class Main
    String d_email = "[email protected]",
    d_password = "inst9",
    d_host = "smtp.gmail.com",
    d_port = "465",
    m_to = "[email protected]",
    m_subject = "Testing",
    m_text = "Hey, this is the testing email.";
    public Main()
    Properties props = new Properties();
    props.put("mail.smtp.user", d_email);
    props.put("mail.smtp.host", d_host);
    props.put("mail.smtp.port", d_port);
    props.put("mail.smtp.starttls.enable","true");
    props.put("mail.smtp.auth", "true");
    //props.put("mail.smtp.debug", "true");
    props.put("mail.smtp.socketFactory.port", d_port);
    props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.socketFactory.fallback", "false");
    SecurityManager security = System.getSecurityManager();
    try
    Authenticator auth = new SMTPAuthenticator();
    Session session = Session.getInstance(props, auth);
    //session.setDebug(true);
    MimeMessage msg = new MimeMessage(session);
    msg.setText(m_text);
    msg.setSubject(m_subject);
    msg.setFrom(new InternetAddress(d_email));
    msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
    Transport.send(msg);
    catch (Exception mex)
    mex.printStackTrace();
    public static void main(String[] args)
    Main blah = new Main();
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    return new PasswordAuthentication(d_email, d_password);
    }

    yes that not a my password ...but the following erroer is occured ...
    run-main:
    javax.mail.AuthenticationFailedException
    at javax.mail.Service.connect(Service.java:319)
    at javax.mail.Service.connect(Service.java:169)
    at javax.mail.Service.connect(Service.java:118)
    at javax.mail.Transport.send0(Transport.java:188)
    at javax.mail.Transport.send(Transport.java:118)
    at Main.<init>(Main.java:41)
    at Main.main(Main.java:51)
    BUILD SUCCESSFUL (total time: 3 seconds)
    I am using the netbeand 5.5

  • Import from javax.mail cannot be resolved

    Hi,
    After migration from Netweaver 7.0 to 7.1 CE, the import of the package  import javax.mail.*
    The error is javax.mail cannot be resolved.
    Do I have to add special Dependencies to my DC?
    Best regards,
    Peter

    Hi
    Please refer following thread.
    [external jar in CE|import a external jar in web dynpro project;
    [external library insight webdynpro |Problem in Reading Excel File from Webdynpro;
    Best Regards
    Satish Kumar

  • Problems sending email using javax.mail.*

    I need to send an email from an application I am working on. I am using the features of the javax.mail package to do so. In looking at the code I am unsure why this is not working. This is my first time using this package so it might be something silly I am missing so any of your thoughts are appreciated. The code is as follows:
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class EmailTester {
         public static void main(String[] args) {
              try {
                   //Set the smtp address
                   Properties props = new Properties();
                   props.put("mail.smtp.host", args[0] );
                   // get the default Session
                   Session session = Session.getDefaultInstance(props, null);
                   session.setDebug(true);
                   // create a message for this session
                   Message msg = new MimeMessage(session);
                   // set the from and to address
                   InternetAddress from =
                        new InternetAddress( args[1] );
                   InternetAddress[] to = new InternetAddress[1];
                   to[0] = new InternetAddress( args[2] );
                   msg.setFrom(from);
                   msg.setRecipients(Message.RecipientType.TO, to);
                   // set the subject and content type
                   msg.setSubject("subject");
                   msg.setContent("this is my test email", "text/plain");
                   // send the email
                   Transport.send(msg);
              catch (MessagingException me) {

    I have an EMail class that I use at:
    http://www.discoverteenergy.com/files/EMail.java
    Feel free to use it or compare against your code to see what is different.

  • Import statement not found for javax.mail.Message

    when i'm in webSphere shich is using jdk1.4.2,
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Session;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    cannot be found
    Where would the Mail classes be located?
    Thank you

    mail.jar and activation.jar, which can be downloaded here:
    http://java.sun.com/products/javamail/downloads/index.html
    http://java.sun.com/products/javabeans/jaf/downloads/index.html

Maybe you are looking for

  • ADF11g: dvt, line graph x-axis (o1 axis) display issue

    Hi, In our application we are generating line graphs for a set of data. This graph is plotted in between 2 sets of numeric values. (one plotted on x-axis and other on y-axis). For better accuracy of plotted graph we are using these numeric values upt

  • Shuffle with Drive Error

    I was given a new shuffle. I can't use it until I get iTunes 7.0.2 ~ when I try to install the program I get the error invalid drive g:\. I have no drive g when I look at my computer. I have called and they can't help me. Does anyone know how I can g

  • Formatting and driving a wd "elements" hard drive for back up purposes

    Hi, I'm trying to format and find a driver for my WD "Elements" 1TB Hard drive to use as a back-up disc. WD don't show any suitable driver.... Can anyone help - a bit of a "Ludite" so.........keep it simple. please!! Many thanks, Ailsa

  • Invoking third party software from APPS

    Hi Gurus, We have a requirement where we would like to invoke thrid party software from APPS. For example when i click on a button in the toolbar we want a document management system to open and show the documents related to the person on the screen.

  • Pic in catalog, but not in folder...

    I am using LR 2.7, Windows 7 ... I have recently established my comfort zone and workflow with LR, CS5 & Bridge. I am going back and pulling everything together with collections and keywords. I have one folder that has 25 pictures in the folder, or s