cara esta dando essa msg Email enfileirado. mas não chega pra min não deve esta faltando alguma coisa vou colocar aqui tudo que eu fiz e como coloquei use msdb
CREATE PROCEDURE sysmail_start_sp
AS
SET NOCOUNT ON
DECLARE @rc INT
DECLARE @localmessage nvarchar(255)
ALTER QUEUE ExternalMailQueue WITH STATUS = ON
SELECT @rc = @@ERROR
IF(@rc = 0)
BEGIN
ALTER QUEUE ExternalMailQueue WITH ACTIVATION (STATUS = ON);
SET @localmessage = FORMATMESSAGE(14639, SUSER_SNAME())
exec msdb.dbo.sysmail_logmailevent_sp @event_type=1, @description=@localmessage
END
RETURN @rc
CREATE PROCEDURE sysmail_stop_sp
AS
SET NOCOUNT ON
DECLARE @rc INT
DECLARE @localmessage nvarchar(255)
ALTER QUEUE ExternalMailQueue WITH ACTIVATION (STATUS = OFF);
SELECT @rc = @@ERROR
IF(@rc = 0)
BEGIN
ALTER QUEUE ExternalMailQueue WITH STATUS = OFF;
SELECT @rc = @@ERROR
IF(@rc = 0)
BEGIN
SET @localmessage = FORMATMESSAGE(14640, SUSER_SNAME())
exec msdb.dbo.sysmail_logmailevent_sp @event_type=1, @description=@localmessage
END
END
RETURN @rc
USE Master
GO
sp_configure 'show advanced options', 1
GO
reconfigure with override
GO
sp_configure 'Database Mail XPs', 1
GO
reconfigure
GO
sp_configure 'show advanced options', 0
GO
reconfigure
EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = 'Diego',
@description = 'Conta de testes do Database Mail',
@email_address = 'diegoferreira.design@gmail.com',
@display_name = 'tsqlmaster',
@username='diego@geekssolucoes.com.br',
@password='11111',
@mailserver_name = 'smtp.gmail.com'
EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = 'Diego',
@description = 'Perfil usado no Database Mail'
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = 'Diego',
@account_name = 'Diego',
@sequence_number = 1
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@profile_name = 'Diego',
@principal_name = 'public',
@is_default = 1;
declare @body1 varchar(100)
set @body1 = 'smtp.gmail.com :'+@@servername+ ' Meu primeiro email através do banco '
EXEC msdb.dbo.sp_send_dbmail @recipients='diego@geekssolucoes.com.br',
@subject = 'Teste de email',
@body = @body1,
@body_format = 'HTML' fiz nessa sequencia ai como esta no tuto! mas se tem algo de errado que fiz me avise concerteza algum Bug tem !!! lololololol abraço