Forward email to SQL server?

  • Does anyone know of a way to send or forward and email to SQL server so it loaded into a table? I've set up email alerts from various applications that send emails to a distribution list and I would like to load the [From], [Subject] and [Date] to a table in SQL.  Currently I am having to manually script the inserts, and would like to automate the process.

  • Hmm... you have to set up something to actually go and read that mail box and insert the appropriate data.  You don't send email to SQL Server you send it to some kind of an email server.  There plenty of ways to do that depending on what email server is but there's nothing native to SQL Server that would just import email into a table.

  • It would seem that you'd be able to get this working using SSIS (for example).
    Here is a sample link showing how to access e-mail messages using C#. The hardest part of getting that to work in SSIS is probably getting the right permissions sorted out. Once you have them in SSIS, pumping them into a SQL Server table should be easy enough.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Looks like SQL 2000 used to have an xp_readmail command but depreciated in SQL 2005.  I've found a few .NET scripts and SSIS. However, the simplest solution looks like Pragmatic Works Task Factory TF-Email Source. Since we are already using Task Factory for SFTP I will use their email source and SSIS: http://blog.pragmaticworks.com/download-emails-email-attachments-in-ssis

  • DavidP-340734 - Tuesday, July 10, 2018 11:36 AM

    Looks like SQL 2000 used to have an xp_readmail command but depreciated in SQL 2005.  I've found a few .NET scripts and SSIS. However, the simplest solution looks like Pragmatic Works Task Factory TF-Email Source. Since we are already using Task Factory for SFTP I will use their email source and SSIS: http://blog.pragmaticworks.com/download-emails-email-attachments-in-ssis

    Sounds like you have a big head start with that. Good luck.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

Viewing 7 posts - 1 through 6 (of 6 total)

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