THIS is the most relevant thread I’ve found on stackoverflow to my question.
If I run EXEC msdb.dbo.sysmail_help_configure_sp;
I can see my default encoding is MIME. When I send CSV attachments, they go to the recipient with UTF-16 encoding. I’ve been requested to change this to UTF-18.
I understand that this SP can alter encoding: EXEC msdb.dbo.sysmail_configure_sp @parameter_name=N'DefaultAttachmentEncoding', @parameter_value=N'MIME'
I changed default encoding to ‘UTF-8’ and sysmail_help_configure_sp
reflected the change, but attached files are still being sent/received as UTF-16. Same result when changing parameter to ‘UTF-18’.
I cannot find a list of acceptable values for the DefaultAttachmentEncoding parameter nor can I see any change in encoding when altering the DefaultAttachmentEncoding value and sending an attachment like
EXEC sp_send_dbmail @profile_name='default',
@recipients='[email protected]',
@subject='subject',
@body='hello',
@query= 'select * from myTable',
@attach_query_result_as_file = 1,
@query_attachment_filename = 'Results.csv',
@query_result_separator = ','
Can anyone provide a list of acceptable values and/or explain what changing DefaultAttachmentEncoding actually does? The documentation for sysmail_configure_sp doesn’t provide or explain.