SQL server mail function sp_send_cdontsmail -
i wrote procedure in tried send mail using below command.
exec sp_send_cdontsmail 'from','to','test','test data'
after executing showing "command(s) completed successfully."
but not getting mail.please me on this.
you need configure database mail , use sp_send_dbmail
send mail. supported procedure, part of sql server.
ps. aware out there code sample circulates advocates along lines of:
create procedure [dbo].[sp_send_cdontsmail] ... exec @hr = master..sp_oacreate 'cdonts.newmail', @mailid out exec @hr = master..sp_oasetproperty @mailid, 'from',@from exec @hr = master..sp_oasetproperty @mailid, 'body', @body ...
this horrible code. 1 can see there absolutely 0 (zero, nada, zip) error checking in code. failure reported 'success'. com interop not raise t-sql notification messages, in hresult, goes unchecked. steer away such code.
Comments
Post a Comment