How to access exchange server emails from sql server

  • Hi,

    How to access exchange server mail from sql server? My requirement is i have to access a mail sent to particular address from exchange server and after parsing ,need to be inserted in to sql server table. Is there any simple method? I don't have any idea on exchange server concepts.

    Thanks,

    deepkt.

  • Try googl'ing "Exchange OLEDB provider".

    You should be able to create a linked server and query Exchange data as a database.

    Hope this helps

    Gianluca

    -- Gianluca Sartori

  • Thanks for your reply.

    If possible please post some code. Suggest me list of steps. Is it possible to connect Exchange server 2007 using SSIS?

    Thanks.

  • deepkt (12/1/2011)


    Thanks for your reply.

    If possible please post some code. Suggest me list of steps. Is it possible to connect Exchange server 2007 using SSIS?

    Thanks.

    http://msdn.microsoft.com/en-us/library/ms191461.aspx

    EXEC sp_addlinkedserver 'exchange',

    'Exchange OLE DB provider',

    'exoledb.DataSource.1',

    'file:\\.\backofficestorage\localhost\public folders'

    CREATE VIEW Contacts

    AS

    SELECT convert(nvarchar(30),"urn:schemas:contacts:sn") LastName,

    Convert(nvarchar(30),"urn:schemas:contacts:givenname")

    FirstName,

    Convert(nvarchar(30), "urn:schemas:contacts:o") Company,

    Convert(nvarchar(50), "urn:schemas:contacts:email1") Email,

    "urn:schemas:contacts:bday" BirthDay

    FROM OpenQuery(Exchange,

    'SELECT "urn:schemas:contact:sn",

    "urn:schema:contacts:givenname",

    "urn:schemas:contacts:o",

    "urn:schemas:contacts:email1",

    "urn:schemas:contacts:bday"

    FROM ''.\contacts''')

    Try. If you can't get it to work, post back with what you attempted and I'm sure people will be glad to help.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • I think you might have a problem:

    http://social.technet.microsoft.com/Forums/eu/exchange2010/thread/d89a1909-f76d-47aa-a31d-06d4ad1620c0

    This shouldn't work for Exchange 2007 or 2010.. Does your experience differ?

    CEWII

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply