Connectiong to Exchange Server through JAVA

Hi friends,
I am new to java mail.i have a problem with connecting to exchange server thru java. my java program sends a mail.but i want to get an alert when ever received a mail and also download the mail to local disk from exchange server.
so if you can please help me.Reply to this ,send me the links or sample codes / paste here itself.
Advance Thanks,
Sankar.P

Hi friends,
I am new to java mail.i have a problem with connecting to exchange server thru java. my java program sends a mail.but i want to get an alert when ever received a mail and also download the mail to local disk from exchange server.
so if you can please help me.Reply to this ,send me the links or sample codes / paste here itself.
Advance Thanks,
Sankar.P

Similar Messages

  • Getting problem when connecting to SMTP server through java code

    Hi all,
    I am getting problem when i am going to connect with "Kerio SMTP server" through java code. The error what i am getting is :
    "[16/Sep/2008 15:59:09] Sent: Queue-ID: 48cf8a73-000000f9, Recipient: <[email protected]>, Result: failed, Status: 5.3.2 554 5.0.0 Too many hops (101, max 100), message looping" when sending an email from [email protected]

    Looks like something is set up wrong on your server that's causing messages
    to be forwarded around a loop too many times without ever reaching the destination.
    For instance, if server A forwards to server B, and server B forwards to server A,
    this would happen.

  • Acessing cisco iso server through java

    Hi All,I am trying to access cisco iso server through java but i am getting timeout exception in program i am creating a client object pass all the parameter.it seems my program no is not registered.so anybody give any suggestion
    Posted by WebUser Tubu Mohanty from Cisco Support Community App

    After trying to resolve the issue Cisco TAC sen the following message:
    I will proceed to open a task with my escalation Team. As well I find this,
    http://www.cisco.com/en/US/products/hw/vpndevc/ps2284/prod_release_note09186a00804ceedf.html#wp521096
    Look after CSCec78536
    "WebVPN does not support Java applets that generate http requests. For example, you cannot login to the CiscoSecure ACS application because of this. "
    If anyone has any additional information please post. We are running into more and more prospects/clients using WebVPN approach (w/ out SSL VPN) for providing remote application access.
    Regards,
    -Murat

  • Problem to access POP3 of MS Exchange Server using Java Mail

    {color:#0000ff}Hi,
    I have a requirement to read emails from my office mailbox using POP3 protocol which is in Microsoft Exchange Server.
    My code is given below.{color}
    {color:#0000ff}*package emailadaptor;*
    import java.util.Properties;
    import javax.mail.Session;
    import javax.mail.Store;
    *public class Test {*
    *public static void main(String[] args) {*
    * // POP3 server name of Exchange Server*
    * String host = "popServer.domain.com";*{color}
    {color:#0000ff}*
    * // User name*
    * String user = "domainName\\userName";*
    * String password = "password";
    * // Get a session. Use a blank Properties object.*
    * Session session = Session.getDefaultInstance(new Properties());
    * try{*
    * // Get a Store object*
    * Store store = session.getStore("pop3");*
    * store.connect(host, user, password);*
    * }catch(Exception e){*
    * e.printStackTrace();*
    *{color:#0000ff}I can ping popServer.domain.com from my machine where I am testing the code.*
    For username I have tried with domainName\\userName and username pattern both but unsuccessful. For example if my username if user1 and my domain name is domain1 than the two patterns I have tried are &lsquo;domain1\\user1&rsquo; and &lsquo;user1&rsquo;.
    For both these cases I am getting same error, and below is my error stack Trace.
    *{color}*
    *{color:#ff0000}javax.mail.AuthenticationFailedException: The requested mailbox is not available on this server.*
    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:158)
    at javax.mail.Service.connect(Service.java:291)
    at javax.mail.Service.connect(Service.java:172)
    at emailadaptor.Test.main(Test.java:19)
    *{color}*
    *{color:#0000ff}Please give me some idea and steps what is wrong with this code and if any other information is needed then also let me know that.*
    Please help.
    Regards,
    *Gourab{color}
    *{color}

    Turn on session debugging. What does the protocol trace show?
    Are you able to connect with other mail clients, such as Thunderbird?
    (Outlook doesn't count.)

  • Mail.app supports accessing to Exchange Server through WebDAV OWA

    I have been reading many threads from both here and Microsoft in order to get my mail.app work with my Exchange Server via WebDAV and/ or OWA.
    My case is that I am fine with Entourage but not mail.app.
    Something a few of us may miss is that Mail.app automatically amend the field "Outlook Web Access Server" to something like mail.myserver.com regardless of what you type, as in most cases the correct address is mail.myserver.com/exchange
    So I am digging into my ~/Library/Application Support/Mail and try to find where exactly mail.app store the Account Information but I came out with no luck.
    Can someone guide me through where is the setting stored because I think forcefully change that "auto change" Outlook Web Access Server address may well fix the problem many of us face.

    With 10.5 and Mail 3.0, any luck for this topic?

  • HI, Iam  trying to Integrate Exchange server using Java Mail

    Here is what iam stuck with, I have a problem while conneting to Exchange Server using imap over ssl.
    My code looks like this
    props.put("mail.imap.host",host);
    props.put("mail.imap.sasl.authorizationid","user1");
    props.put("mail.imap.sasl.enable","true");
    props.setProperty("mail.imap.socketFactory.class","javax.net.ssl.SSLSocketFactory");
    props.setProperty("mail.imap.socketFactory.fallback","true");
    props.setProperty("mail.imap.socketFactory.port","993");
    Authenticator auth = new myauthenticator(AdminUserName,AdminPassword);
    Session session = Session.getInstance(props,auth);
    session.setDubug(true);
    Store store = session.getStore("imap");
    store.connect();
    I get the following Exception as
    javax.mail.MessagingException: Software caused connection abort: recv failed;
    nested exception is:
    java.net.SocketException: Software caused connection abort: recv failed
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:571)
    at javax.mail.Service.connect(Service.java:310)
    at javax.mail.Service.connect(Service.java:169)
    at javax.mail.Service.connect(Service.java:118)
    at MoveCalendar.move(MoveCalendar.java:63)
    at SendCalendar.send(SendCalendar.java:74)
    at SendCalendar.main(SendCalendar.java:40)
    Caused by: java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at com.sun.net.ssl.internal.ssl.InputRecord.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
    at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at com.sun.mail.iap.ResponseInputStream.readResponse(ResponseInputStream.java:97)
    at com.sun.mail.iap.Response.<init>(Response.java:96)
    at com.sun.mail.imap.protocol.IMAPResponse.<init>(IMAPResponse.java:61)
    at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:135)
    at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:261)
    at com.sun.mail.iap.Protocol.<init>(Protocol.java:114)
    at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:538)
    ... 6 more
    DEBUG: setDebug: JavaMail version 1.4.1
    DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
    DEBUG: mail.imap.fetchsize: 16384
    DEBUG: enable SASL
    DEBUG: mail.imap.sasl.authorizationid: user1
    If i change the sessionFactory.class or if I remove this property I donot get any Exception It gets Executed well, but IT goes directly to the Adminstrators Mail account but not to the AuthorizationId I gave it. Can any one give me sugssion upon this issue.I don't understand whether the problem was with the Exchange Server I was trying to connect or with my local Environment

    hi,
    Iam very thankful for your reply here's the requested debug steps
    DEBUG: setDebug: JavaMail version 1.4.1
    DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
    DEBUG: mail.imap.fetchsize: 16384
    DEBUG: enable SASL
    DEBUG: mail.imap.sasl.authorizationid: user1
    DEBUG: protocolConnect returning false, host=india.lendingspace.com, user=PMaganti, password=<null>
    * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lsinmail.india.lendingspace.com) ready.
    A0 CAPABILITY
    * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
    A0 OK CAPABILITY completed.
    IMAP DEBUG: AUTH: NTLM
    DEBUG: protocolConnect login, host=****, user=AdminUserName, password=<non-null>
    IMAP SASL DEBUG: Mechanisms: NTLM
    IMAP SASL DEBUG: No SASL support
    A1 LOGIN AminUserName AdminPassword
    A1 OK LOGIN completed.
    A2 CAPABILITY
    * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
    A2 OK CAPABILITY completed.
    IMAP DEBUG: AUTH: NTLM
    DEBUG: connection available -- size: 1
    A3 SELECT INBOX
    * 1 EXISTS
    * 1 RECENT
    * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
    * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
    * OK [UNSEEN 1] Is the first unseen message
    * OK [UIDVALIDITY 261914] UIDVALIDITY value
    A3 OK [READ-WRITE] SELECT completed.
    No of Messages msgs 1
    A4 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
    * 1 FETCH (ENVELOPE ("5 Mar 2009 13:25:19 +0530" "Outlook Calendar Events Using Java" ((NIL NIL "XXXXX" "XXXXX")) ((NIL NIL "XXXXX" "XXXXX")) ((NIL NIL "XXXXX" "XXXXX")) ((NIL NIL "XXXX" "XXXX")) NIL NIL NIL "<XXXXX>") INTERNALDATE " 5-Mar-2009 13:25:19 +0530" RFC822.SIZE 1348)
    A4 OK FETCH completed.
    FROM: XXXX
    SUBJECT: Outlook Calendar Events Using Java
    DATE: Thu Mar 05 13:25:19 IST 2009
    A5 FETCH 1 (BODYSTRUCTURE)
    * 1 FETCH (BODYSTRUCTURE (("TEXT" "CALENDAR" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 598 10 NIL NIL NIL) "mixed" ("boundary" "----=_Part_0_18680399.1236239719654") NIL NIL))
    A5 OK FETCH completed.
    [ Multipart Message ]
    CONTENT:TEXT/CALENDAR; charset=US-ASCII
    A6 STORE 1 +FLAGS (\Answered)
    * 1 FETCH (FLAGS (\Answered \Recent))
    A6 OK STORE completed.
    A7 COPY 1 CALENDAR
    A7 OK [COPYUID 262745 258 23] COPY completed, 1 messages copied.
    A8 EXAMINE INBOX
    * 1 EXISTS
    * 0 RECENT
    * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
    * OK [PERMANENTFLAGS ()] Permanent flags
    * OK [UNSEEN 1] Is the first unseen message
    * OK [UIDVALIDITY 261914] UIDVALIDITY value
    A8 OK [READ-ONLY] EXAMINE completed.
    A9 CLOSE
    A9 OK CLOSE completed.
    DEBUG: added an Authenticated connection -- size: 1
    A10 LOGOUT
    * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
    A10 OK LOGOUT completed.
    DEBUG: IMAPStore connection dead
    DEBUG: IMAPStore cleanup, force false
    DEBUG: IMAPStore cleanup done
    Actually what iam doing is read a mail which was more recent in inbox and If it is an Calendar event Iam copying that mail to Calendar Folder. So that Microsoft OUTLOOK automatically recongnizes them and secudles them in it's Calendars
    This is actually done for adminstrator's Account but not for the user1
    As you have suggested I removed the socketFactory class stuff and did this.
    and this is my modified Code
    props.put("mail.imap.host",imapHost);
    props.put("mail.imap.sasl.enable", "true");
    props.put("mail.imap.sasl.authorizationid", "user1");
    Authenticator auth=new myauthentication(imapUserName,imapPassword);
    Session session = Session.getInstance(props,auth);
    session.setDebug(true);
    store = session.getStore("imap");
    store.connect();
    And that goes like that.

  • Exchange Server 2007 / Java issue

    We have just upgraded to Exchange Server 2007. We have a couple of web apps that add an appointment automatically to users calendars using HttpClient PostMethod. Since the upgrade this no longer works. Any ideas or suggestions?

    Hi,
    From your description, I would like to verify the following things for troubleshooting.
    1. Were you able to send and receive emails before?
    2. What type of email account is configured in Outlook?
    3. Please check if you can send and receive emails using OWA.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Bypassing Proxy Server through java

    Hi !!
    I`m creating a web browser in JAVA for my college project.I`m using JEditorPane to display HTML in my browser.
    My project is running fine at my home where i`ve no proxy but in college, I have a requirement to display HTML pages through a Cyberoam Server running at port 3128.The authentication is done thru Cyberoam client software which is done by the user itself on logging into Windows, so my application has no role in that.
    Please help me in regards to how to move through this Cyberoam firewall.
    Waiting for a response,
    Amit Sharma

    remember Google is your friend. I got this off of a Google
    http://java.sun.com/developer/technicalArticles/DataTypes/proxy/
    Since this is for a college project and the instructor had imposed the requirement of using Cyberoam, I'd suggest you take better notes in class--I've never had a class where the instructor made something mandatory without a discussion on how to approach it and supply resources where nessisary to do so.

  • Connect to unix server through java

    Hi All,
    I've seen this topic being discussed here, but I want to clarify my situation.
    I'm a college student, so our school provides us accounts to a unix server.
    I am writing a java program that needs to connect to this unix server owned by the school, and run some commands and obtain the results and display them in the same java program.
    for example after the connection, I use the java Runtime() method to pass the "pwd" command from my program, and my java program should receive the result something like "/university/student/program" from the server, and I should be able to display in the java program.
    I feel like since the unix from school is already acting as a "server," I don't need to write the server side code, it should be handled by the unix system, right?
    Can someone give me a sample code on how to establish such connection?
    BTW, I usually use ssh to access the unix server.
    Much appreciated, and it's kinda urgent.
    Thank You.

    There are ssh clients written in Java so I'm not really sure you really want the following code because it accesses ssh using Runtime.exec(). I have never used this with anything except Linux so I assume that your client ssh is in a directory that is on the PATH.
    If your server ssh is set up to do public key authentication then you will not have to supply the user password. If you do require a password then on Linux FC5 you will be prompted though a dialog. I don't know how you provide the password in Windows.
    import java.io.*;
    public class Fred117_1
        static class AsyncPipe implements Runnable
            public AsyncPipe(InputStream istrm, OutputStream ostrm)
                istrm_ = istrm;
                ostrm_= ostrm;
            public void run()
                try
                    final byte[] buffer = new byte[1024];
                    for (int length = 0; (length = istrm_.read(buffer)) != -1;)
                        ostrm_.write(buffer, 0, length);
                catch (Exception e)
                    e.printStackTrace();
            private final OutputStream ostrm_;
            private final InputStream istrm_;
        public static void main(String[] args) throws Exception
            final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
            final String LINE_SEPARATOR = System.getProperty("line.separator");
            final Process process = Runtime.getRuntime().exec(isWindows ? "cmd.exe" : "sh");
            new Thread(new AsyncPipe(process.getErrorStream(), System.err)).start();
            new Thread(new AsyncPipe(process.getInputStream(), System.out)).start();
            final Writer writer = new OutputStreamWriter(process.getOutputStream(), "UTF-8");
            final String[] shCommands =
                "ssh alpha",
                "df -k",
                "ls",
            for (String shCommand : shCommands)
                System.out.println(shCommand);
                writer.write(shCommand);
                writer.write(LINE_SEPARATOR);
            writer.close();
            final int returnCode = process.waitFor();
            System.out.println("Return code = " + returnCode);
    }

  • Problems connecting to exchange server through VPN

    I use Cisco VPN client version
    5.0.0.1.0600 over a cellular line. Telenor 3G. I use a Nokia E65 with nokia PC suite and standard bluetooth modem.
    The tunnel connects and all is well until I open Outlook. I get prompted for a username/password. None of the usernames work. I tried everything from domain admin to testuser. I get the following error:
    http://img155.imageshack.us/img155/7406/46816658fr7.jpg
    It works fine with VPN over xDSL. Does anyone know what's up?

    Hi,
    For info. VPN Client 5.0.02.0090 has the following resolved issue stated in the readme-file:
    Resolved Issues:
    CSCsh15103 Client using a Digital Cert cant connect thru a Cable/DSL router
    It's the opposite of your problem but might be worth a try anyway?
    Also, have you tried the usual MTU change to 1300. Outlook have problems if there are any MTU issues on the way.
    //Rob

  • Can java mail be used for distributed exchange server?

    H,
    I am trying to connect to MS Exchange Server to read my mails using Java Mail API.
    I have a questions about using it with Exchange server.
    We have 6-7 exchange servers in our company and different users have mailboxes on different servers. My internet mail application will be used by everybody in the company.
    But while connecting to exchange server using java mail I can only cnnnect to one server and port. What happens when user mailbox is not on that server. How can I use javamail in this scenario where user mailboxes are on separate servers??
    Thanks
    [email protected]

    You said that you can connect to Exchange server my you help me with this because i cant connect to Exchange server, mayby you can post me a code example? Thanks

  • Can LabVIEW send an email through Microsoft Exchange server without an account set up in Outlook?

    I've found sample code that shows how to send email through Outlook using LabVIEW.  On any computer I log into on our network, my profile loads and I have access to the exchange server through Outlook so the code works.
    However, I am developing a program that will run on a lab computer with a generic PC login that is shared among everyone in the lab.  Exchange server/outlook is not set up for the generic user.
    Is it possible to have labVIEW send an email through the exchange server with a server name, username, and password coded into the executable?

    You would need to send a standard SMTP message via Exchange. The Exchange server will likely require authentication, so you won't be able to use the built-in SMTP VIs, as they do not support authentication. If you're on Windows you can use .NET (see this example), or use the OpenG SMTP VIs.

  • How to access exchange server's features with java?

    I can send/receive mail to MS Exchange Server using JavaMail API. Thats working fine but is it possible to acess other features of MS Exchange Server? At least is it possible to get the list of users in exchange server using java?

    JavaMail only speaks the standard internet protocols. I know very little about Exchange,
    but I suspect many of its features are not accessible using standard internet protocols.
    It's very unlikely that you can get a list of users using one of the standard internet mail
    protocols. Certainly none of the protocols support that as a standard feature.

  • MacBook Pro, Snow Leopard and Exchange Server

    My wife is considering a MacBook Pro for her business (we have one at home). At her work they have Exchange Server. With our home MacBook Pro I have been able to connect to her Exchange server through Entourage. (however I think her Exchange server is version 4 and not 7). Anyway, we are getting mail, contacts and her calendar through Exchange but we are not getting shared calendars and I don't know how to access her files on the Exchange server. I really want her to buy a MacBook but we need to make sure that shared calendars and file sharing works. Can someone inform me about this?
    Her company is upgrading to Exchange server 7 in December and I know that Snow Leopard allows Exchange to work through Mail, Address Book and iCal. Again, I need to know if calendar sharing and file sharing can work. Thanks.

    Hello,
    Wondering if you had any luck getting this issue resolved (I have the exact same question).
    Thanks,
    -Todd / Chicago

  • N70 Exchange Server Sync

    Hi,
    I read that Nokia have licensed Activesync to allow business users (e.g. Me) to sync their N70 devices with an MS Exchange Server. Does anyone know what the status is of this? All I can find on Nokia.co.uk is a year-old press release...
    In the interim, does anyone know how I can sync my N70 with Exchange?
    Thanks in advance...
    neil

    Nokia has, indeed, licensed the ActiveSync technology to talk directly to Exchange servers. However, no phones with support for it has been released by Nokia yet (in any case, I would look for that support to first appear in Eseries devices like the E61 or E70).
    In the meanwhile, you can synchronize with an Exchange server through a local synch with a PC (Outlook) using PC Suite:
    http://www.nokia.com/pcsuite
    A remote (over-the-air, OTA) synchronization is also possible, if you have a, so called, SyncML Server connected to/with your Exchange server.
    DataViz is also adding support for S60 devices (like the N70) for their RoadSync product:
    http://www.dataviz.com/solutions/enterprise/roadsync/supported_devices.html
    Nokia Business Center also allows Exchange server connectivity OTA:
    http://europe.nokia.com/nokia/0,0,77174,0.html

Maybe you are looking for

  • How can I stop Verizon from sending me texts and calling my phone?

    I am not the primary on the account. The primary has called and complained numerous times and was told each time, my number isn't in the system and I shouldn't be getting these, but the calls and texts keep coming, dozens per month, every month. When

  • PCI-MI0-16XE-50 Failing Self-test

    I am using a PCI-MI0-16XE-50 which is failing the self-test in MAX 3.1.1.3004.  I have used the E Series Diagnostic Utility which gives the error "Error 10809 occurred at cwdaq:  Starting DAQ operation Attempted to start a pulse width measurement wit

  • Run separate Process

    I want to execute Ftp process when executing the program,but it is not working properly, what is wrong in the code.If it is wrong how to do? public class check      public static void main(String[] args) throws Exception           Runtime r = Runtime

  • Pacman issue - error: .. : No such file or directory.

    It seems I have my first issue, and it's with Pacman. I get this error everytime I sync the database or install a package, even though everything seems to go fine. error: /var/lib/pacman/extra/flite-1.3-2/desc: No such file or directory I don't know

  • IS Utilities solution fitment

    Hi, Is IS Utilities the correct solution firment for electricity generating companies. In our case the electricity generation is based on heavy oil and natural gas fuel type. The generation type is based on steam, gas turbine. combined cycle and Wind