Read mail using SQL Server 2008 r2

  • Hi,

    I have configured SQL Server database mail.

    Now i want to read mail of ID that i have configured in SQL Server 2008 r2 database mail.

    is it possible?

    How?

    Thanks.......
    -----------------------------------
    My Blog[/url] | Articles

  • Don't really understand what is your objective but may be you are looking for

    select *

    from msdb..sysmail_allitems

  • UmaShankar Patel (5/22/2013)


    Hi,

    I have configured SQL Server database mail.

    Now i want to read mail of ID that i have configured in SQL Server 2008 r2 database mail.

    is it possible?

    How?

    not directly, and not in TSQL. and it's not a trivial task to be able to add that ability...it requires some coding.

    this is easily done in a programming language, so you could add a suite of CLR procedures to do any of the typical steps you would do for reading mail, ie CLR_GetlistOfMessages, CLR_ReadOneMessage,

    CLR_GetAttachmentFromOneMessage,

    CLR_Deletemessage, etc

    best bet is to find one of the many examples for POP3 / IMAP reading in c#.net or vb.net, and

    if you are up to the programming portion of it, i may have a prototype i built a while ago i could post.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • i should have mentioned to google for a SQL Server CLR+read email, you might have some luck finding something that already exists.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I have done this before using the msdb tables.

    you might want to try SELECT * FROM sysmail_sentitems.

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

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