Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Regarding Send mail option in sql

Author  Topic 

HareeshGowtham
Starting Member

2 Posts

Posted - 2012-07-21 : 00:45:19
Dear All,

I need to send mail from sql-server 2008. I dont this with the help of below statement.

EXEC master.dbo.xp_sendmail
@recipients=N'sundar@nlogixsolutions.com',
@message=N'Hi this is testing mail from sqlserver' ;


But i got the result as below


SQL Server blocked access to procedure 'sys.xp_sendmail' of component 'SQL 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 'SQL Mail XPs' by using sp_configure. For more information about enabling 'SQL Mail XPs', see "Surface Area Configuration" in SQL Server Books Online.



what are the steps i have to do for solving this issue???

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-21 : 02:42:21
Enable the feature via sp_configure.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-21 : 13:13:28
why are you using xp_sendmail? I prefer using sp_send_dbmail which is SMTP based.
SQL Mail relies on MAPI protocol and you will have to create a mail profile on the server for using it.
SQL database mail's mail delivering process runs outside of SQL server. SQL server just queues the mail for processing and it can continue to queue mails even when the outside process is stopped. That increases reliability. Database Mail works on background and does asynchronous delivery

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2012-07-22 : 11:22:59
quote:
Originally posted by visakh16

why are you using xp_sendmail? I prefer using sp_send_dbmail which is SMTP based.
SQL Mail relies on MAPI protocol and you will have to create a mail profile on the server for using it.
SQL database mail's mail delivering process runs outside of SQL server. SQL server just queues the mail for processing and it can continue to queue mails even when the outside process is stopped. That increases reliability. Database Mail works on background and does asynchronous delivery

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





And, does not require a MAPI client installed on the server (e.g. Outlook) or an account created in Exchange for the profile. Database Mail uses SMTP and just needs access to the SMTP relay.

It is much simpler to setup, configure and manager - which is why SQL Mail has been deprecated and shouldn't be used anymore.
Go to Top of Page
   

- Advertisement -