这有效:
EXEC msdb..sp_send_dbmail
@recipients = 'myaddress@helloworld.co.uk',
@subject = 'HELLO WORLD',
@Importance = 'LOW',
@body = 'HELLO WORLD',
@file_attachments = N'UNCpathway\experimental attachment.txt'
而当我尝试这个时
EXEC msdb..sp_send_dbmail
@recipients = 'myaddress@helloworld.co.uk',
@subject = 'HELLO WORLD',
@Importance = 'LOW',
@body = 'HELLO WORLD',
@file_attachments = N'UNCpathway\experimental attachment.xlsx'
我收到以下错误消息:
消息 22051,级别 16,状态 1,第 0 行无法打开附件文件“UNCpathway\experimental attachment.xlsx”。执行 API 'CreateFile' 失败,错误号为 32。
该消息很奇怪,因为我没有要求打开附件!为什么?如何允许使用这些附件?