Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SQL Server发送邮件时出错_Sql_Sql Server_Email - Fatal编程技术网

使用SQL Server发送邮件时出错

使用SQL Server发送邮件时出错,sql,sql-server,email,Sql,Sql Server,Email,我正在使用SQL Server的sp\u send\u dbmail存储过程,经常收到错误消息: 邮件未排队。数据库邮件已停止。使用sysmail\u start\u sp启动数据库邮件 之后,我使用executedbo.sysmail\u start\u sp在SQL Server中再次启动电子邮件服务 可能是什么导致了这个错误?有人知道吗,请告诉我 我想这会帮助你…从这个URL找到它 使用sysmail\u start\u sp启动服务后,运行以下脚本。这将解决问题 SET NOCOUNT

我正在使用SQL Server的
sp\u send\u dbmail
存储过程,经常收到错误消息:

邮件未排队。数据库邮件已停止。使用sysmail\u start\u sp启动数据库邮件

之后,我使用
executedbo.sysmail\u start\u sp
在SQL Server中再次启动电子邮件服务


可能是什么导致了这个错误?有人知道吗,请告诉我

我想这会帮助你…从这个URL找到它 使用sysmail\u start\u sp启动服务后,运行以下脚本。这将解决问题

SET NOCOUNT ON
Declare @ch uniqueidentifier;
Declare @message_type nvarchar(256);
Declare @message_body nvarchar(max);
Declare @ctr bigint;
Declare @ctr2 bigint;
While (1=1)
Begin
Receive @ch = conversation_handle, @message_type = message_type_name from ExternalMailQueue
set @ctr2 = @ctr2 + 1
set @ctr = (select count(*) from ExternalMailQueue)
if @ctr = 0 
break
end

你检查过SQL Server日志了吗?我怎么做?请您提供查询以执行此操作。在您喜爱的搜索引擎中键入
sql server日志
,单击第一个链接。@TT。是否有任何方法可以检查sql server中的邮件服务是否正在运行或停止?