Hi -
I have a procedure that sends an email using database mail proc dbo.sp_send_dbmail. I have one parameter which is declared as Nvarchar(4000) and which reciecves text in any language other than english. When I execute the proc it sends an email but the any japanese text in the body is replaced with ???????.
DECLARE @EmailBody NVARCHAR(4000)Declare @comments Nvarchar(4000)
set @comments = 't'
SELECT @EmailBody = '<html><p>
Client: '+ISNULL('Jennifer','')+' '+ISNULL('Matt','')+'<br>
Account: '+ISNULL('abc','')+'<br>
Score: '+ISNULL('1','')+'<br>
Comments: '+ISNULL(@comments,'')+'<br>
</p></html>'
-- send alert email using db_sendmail
EXEC msdb.dbo.sp_send_dbmail @recipients='abc@xyz.com', @subject='test', @body = @EmailBody, @body_format = 'HTML'
When I execute the above code then it sends an email with 'Comments' as ???????? instead some japanese text.
I tried by putting N as prefix like below but it still don't send japanese text in email body instead sends ???????
DECLARE @EmailBody NVARCHAR(4000)
Declare @comments Nvarchar(4000)
set @comments = 't'
SELECT @EmailBody = '<html><p>
Client: '+ISNULL('Jennifer','')+' '+ISNULL('Matt','')+'<br>
Account: '+ISNULL('abc','')+'<br>
Score: '+ISNULL('1','')+'<br>
Comments: '+N''+ISNULL(@comments,'')+''+'<br>
</p></html>'
How can i solve this problem?
Thanks,