Hi friendz,
i already posted Create Account and profile in sql server 2005 and sent sql mail on trigger in sql server 2005 . 2day I'm showing sending mail through store procedure
code
ALTER PROCEDURE [dbo].[SP_Candidate_ReferAFriend_Email]
@ToEmail varchar(200),
@Msg varchar(MAX),
@Subj varchar(200)
AS
BEGIN
-- SENDING EMAIL
BEGIN TRY
EXEC msdb.dbo.sp_send_dbmail
@recipients = @ToEmail,
@body = @Msg,
@sensitivity ='Personal',
@importance ='High',
@body_format = 'HTML',
@subject = @Subj,
@profile_name = 'Simplyasp'
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() as ErrorNumber,
ERROR_MESSAGE() as ErrorMessage;
END CATCH
END
for easy understanding i had given all parameter friendly name. i hope u can easily understand. :).
Have a nice day... 'N happy Coding :)
No comments:
Post a Comment