receive emails in coldfusion

I would like to receive emails from exchange server and use it in coldfusion.
How do I go about doing this? Don't want to use POP3. Please help ASAP
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brijesh ChauhanStaff IT EngineerCommented:
Which version of CF you are on ?

you can use the CFEXCHANGE tag if you are on CF 8 and above

here is the article with complete information
cfuserAuthor Commented:
I tried using cfexchange tag and I get connection to server refused. I am passing username, password and server IP correctly. Any thoughts?

Connection is refused.  
Ensure that the Exchange server is running and that it supports the protocol (HTTP or HTTPS) you have specified for accessing it.  
cfuserAuthor Commented:
I am using CF9
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Brijesh ChauhanStaff IT EngineerCommented:
cfuserAuthor Commented:
Thanks much. I tried the below code and get the same connection refused message.

username ="MHSSD_EventMgmt"

<cfdump var="#testconn#">

Try this connection.

username ="domain\username"
server="ip of exchange server"

 connecting to owa isn't the way to do it. You will also have to import the exchange certificate into cacerts.
Brijesh ChauhanStaff IT EngineerCommented:
You need to ensure the following

   Ensure that IIS is configured for access to the Exchange server

    Enabling Outlook web access

    Check and grant web access

    Enabling HTTPS access to the Exchange server

    Enabling SSL on the Exchange server system

    Enabling HTTPS access on the ColdFusion server

Then you can do

    action = "open" 
    username = "#user1#" 
    password = "#password1#" 
    server = "#exchangeServerIP#" 
    connection = "conn1"> 
<cfexchangemail action = "get" name = "spamMail" connection = "conn1"> 
    <cfexchangefilter name = "fromID" value = "">  
<cfloop query="spamMail"> 
    <cfexchangemail action = "delete" connection = "conn1" 
            uid = "#spamMail.uid#"> 
    action = "close" 
    connection = "conn1">

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.