【问题标题】:sp_send_dbmail not sending Email when row inserted from Website从网站插入行时 sp_send_dbmail 不发送电子邮件
【发布时间】:2014-04-17 18:42:26
【问题描述】:

我有一个表格,如果在其中插入行,我会发送一封通知电子邮件。如果我使用 SQL Server Management Studio 手动插入一行,它工作正常,但如果我从 Web Interface 插入一行,它会失败。 Jsut 无法弄清楚为什么从 Web UI 插入会失败?这是发送电子邮件的代码:

exec msdb.dbo.sp_send_dbmail 
@profile_name = 'ABC',  
@recipients = @to, 
@subject = @subject, 
@body = @body

【问题讨论】:

    标签: triggers sql-server-2012 database-mail


    【解决方案1】:

    我想出了解决办法。问题出在数据库邮件的配置文件设置上。我使用的配置文件被设置为私人。因此,通过网站向表中添加行的进程没有使用数据库邮件的权限。我无法弄清楚通过 UI 对数据库进行了哪些 id 更改。但是我创建了一个公开的个人资料并用它来发送电子邮件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-12
      • 2016-02-18
      • 2014-05-22
      • 1970-01-01
      • 2011-12-22
      • 1970-01-01
      • 2012-09-20
      • 1970-01-01
      相关资源
      最近更新 更多