in reply to Re^3: Connect to Microsoft Exchange
in thread Connect to Microsoft Exchange

Thanks Alexander

I installed Mail::IMAPClient but i m not able to connect to the exchange server.

use strict; use warnings; use Mail::IMAPClient; my $imap = Mail::IMAPClient->new( Server => 'XXXX.YYYY.com', User => 'XXXX', Password => 'YYYY', Ssl => 1, Uid => 1, ); my $folders = $imap->folders or die "List folders error: ", $imap->LastError, "\n"; print "Folders: @$folders\n";
Thanks

Replies are listed 'Best First'.
Re^5: Connect to Microsoft Exchange
by afoken (Chancellor) on Nov 26, 2010 at 11:04 UTC

    Are you sure IMAP is enabled on the Exchange server? With SSL? Have you asked the server admin or did you run a port scan? What output do you see? Why don't you check that new() was successful?

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      I m not very sure if IMAP is enabled.Also tried commenting SSL but it didn't work.I think this script would also help me identify if the port is enabled or not( pls correct me if i am wrong). The call to new didn't succeed and didn't return an object that is the reason i m unable to call the method folders with it

      Thanks

        Here is the error that i get:

        " Unable to connect to xxx.yyy.com: IO::Socket::INET: connect: Connection refused at ./chk_mail_imapclient_.pl line 9. "