I have a table in which if row is inserted I send a notification email. It works fine if I insert a row manually using SQL Server Management Studio, but fails if I insert a row from Web Interface. Jsut can't figure out why it would fail with insert from web UI? Here's the code for sending email:
exec msdb.dbo.sp_send_dbmail
@profile_name = 'ABC',
@recipients = @to,
@subject = @subject,
@body = @body