I tried using : sp_send_dbmail
But I got the following error:
Msg 15281, Level 16, State 1, Procedure sp_send_dbmail, Line 0
SQL Server blocked access to procedure 'dbo.sp_send_dbmail' of component 'Database Mail XPs' because this component is turned off as part of the security configuration for this server.
A system administrator can enable the use of 'Database Mail XPs' by using sp_configure. For more information about enabling 'Database Mail XPs', see "Surface Area Configuration" in SQL Server Books Online.
I also tried to use this code to send SMTP mail in SQL Server 2008 R2 EXPRESS: http://www.freevbcode.com/ShowCode.asp?ID=6699
But I am getting the following error:
Msg 15281, Level 16, State 1, Procedure sp_OACreate, Line 1
SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface Area Configuration" in SQL Server Books Online.
I went to the "Facets" to check the security options there, but there is nothing about "Surface Area Configuration"! Is it missing because I am using the Express version of the SQL Server 2008 R2? Or am I going in the wrong direction?
If you have any better code/suggestion for sending mail in SQL Server 2008, please let me know. Thanks!