SQL Server to Send Mail


i followed example here:

http://www.codeproject.com/kb/database/sqlserver2008databasemail.aspx

 

everything fine point:

use

msdb

go

exec

sp_send_dbmail @profile_name='pinalprofile', _

@recipients='test@example.com', @subject='test message', _

@body='this body of test message. _

congrats database mail received successfully.'

 

i substituted in own profile­_name , own recipients.

 

when selected script , hit f5, got this:

msg 102, level 15, state 1, line 3

incorrect syntax near '@recipients'.

 

 

hi

you don't need _ .

  sp_send_dbmail @profile_name='pinalprofile', @recipients='test@example.com', @subject='test message',  @body='this body of test message. congrats database mail received successfully.'  

vt


please mark answered if i've answered question , vote helpful other user's find solution quicker


SQL Server  >  Getting started with SQL Server



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........