Sending Mail

  • How to send a mail through Storedprocedures with out using system stored procedures

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Why do you not want to use the built in SQL mail procedures?

    One way would be to build a CLR proc which does the sending of the mail for you.

  • To My knowledge the only way to do it is using xp_sendmail, the only other way would be to run an xp_cmdshell to call an external SMTP program, or write your own CLR to send the mail, but I think theres security limitations in what a CLR can do.

    However why would you want to reinvent the wheel and not use xp_sendmail?

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices

  • kapil_kk (11/1/2012)


    How to send a mail through Storedprocedures with out using system stored procedures

    What? without system stored procedures? like msdb.dbo.sp_send_dbmail?

    so you are saying instead of using the built in, standardized, tested and fully functional system that is included free, you want to use something else?

    if you really wanted to use something else, it depends.

    You could make a CLR that calls the built in .NET functionality to send a mail, but that would probably make synchronous calls and would be slower than sp_send_dbmail.

    if you enable xp_cmdshell, you could call any exisitng third party dll via SP_OACreate.

    you'll be much better off explaining why you think you cannot use sp_send_dbmail for a better answer.

    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!

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

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