exec master..xp_sendmail

Discussion in 'Databases' started by mmerrens, Dec 9, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'd like to make use of the above in a trigger to notify me of specific changes. Is it possible to use this syntax and, if so how:

    This is the syntax I would normally use:

    exec master..xp_sendmail
    @recipients = '[email protected]',
    @subject = @Subject,
    @message = @Body

    I could not find any documentation about this here so need to know if you support it.

    Thanks
     
  2. I think you'll need to open a Support Ticket.
    Unless I'm mistaken the mail component would need to be enabled on the SQL box.
    You can however send mail on your site once the query is returned.
     
  3. mjp

    mjp

    I am afraid that we do notallow mail to be sentfrom the SQL servers.

    mjp
    ---
    DiscountASP.NET
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Allowing sending mail from the SQL server is not such a good idea because


    1) We need to expose the SMTP port on the SQL server which allows for more potential security issue.


    2) In our view, the SQL server is a database server rather than an application server. It is best for the SQL server to handle just the database.


    You can, however, workaround this by creating a simple ASP or ASP.NET application to query the SQL server and send email.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. There are numerous problems and serious security implications.
    (Whichshould not be discussed of course.)

    I've done this from SQL Server and in ASP, ASP.NET and Crystal Reports.
    In each of those you have a better handle onmail security and features.

    From experience I can tell you the SQL mail component will make things harder to manage.

    Use Google and search for problems related to using: SQL Agent Mail and SQL Server Mail
    Salute,
    Mark
     
  6. No, of course...


    I was being a trifle sarcastic regarding MS and the efficacy of using this feature: perhaps a sarcasm smiley was called for?


    I've already enabled the c# code to do this and it works fine althoughIalso have no bad experiences to report having done this froma numberofs/m/l sized applications: a lot of the issues are down to how it is all set up (apparently).


    Still, not a problem.

     
  7. Takeshi Eto

    Takeshi Eto DiscountASP.NET Staff

    Many of the features that Microsoft puts in are focused on the needs of their Enterprise customers. It is only now that Microsoft is starting to consider what features Shared Hosters are looking for.

    We understand that certain features may be available and may be easy to turn on or install. But one of our primary focus is to make sure that our system is reliable, stable, and secure for all our customers who use our shared hosting platform.So if a featurecan potentially degrade service performance for our customersor open up security issues, and there are cleaner alternatives,thenwewill not make these features available.


    Eric
    http://www.DiscountASP.NET - Microsoft Gold Certified Partner
    - asp.netPRO Magazine 2007 Readers' Choice Award for Best ASP.NET Hosting Service
    - Visual Studio Magazine 2007 Readers' Choice Award for Best .NET Hosting Service
     
  8. Thanks: fair enough though I can't agree with point 2 or why would MS (in all their wise and wonderful glory) have bothered to include the ability to do so? This feature is very useful and negates the need to have to write extra code in the application when the database can handle it earlier and more efficicently.

     
  9. I find myself in the same boat here --


    I'm trying to send an email message whenever a given record is updated. I've created a trigger that fires when the conditions are right, but have no idea how to get the website/application to send email when that trigger fires. I'm using C#, .NET 2, SQL Server 2005.


    Can someone point me in the right direction?
     
  10. Have thesame application that updates the record email you after the update.


    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page