hi,
currently, I use the following code to send email from SQL, our email provider recently changed theor email, we need to login in using username password before we send email out...how can I get this to work? thx
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE dbo.st_SendEmail
@S_FROM_NAME varchar(50), @S_subject varchar(50), @S_message varchar(100)
AS
SET NOCOUNT ON
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmai
l
@FROM = N'someemail@domain.com',
@FROM_NAME = @S_FROM_NAME,
@replyto = N'someemail@domain.com',
@TO = N'someemail@domain.com',
@CC = N'',
@BCC = N'',
@priority = N'NORMAL',
@subject = @S_subject,
@type = N'text/plain',
@message = @S_message,
@messagefile= N'',
@attachment = N'',
@attachments= N'',
@codepage = 0,
@timeout = 10000,
@server = N'putgoing.email.server'
select RC = @rc
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Start Free Trial