level 1
yf1022
楼主
发送不带附件的邮件没有问题,只要带附件就报错误。
消息 22051,级别 16,状态 1,第 0 行
附件文件 D:\Serial.txt 无效。
DECLARE @itemID INT
DECLARE @AttachFile nvarchar(max)
SET @AttachFile = 'D:\Serial.txt'
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'sp_send_dbmail',
@recipients = '[email protected]',
@body = '查询结果在附件中',
@subject = '查询结果',
@body_format ='HTML',
@mailitem_id = @itemID OUTPUT,
@file_attachments = @AttachFile
print @itemID
2017年10月19日 11点10分
1
消息 22051,级别 16,状态 1,第 0 行
附件文件 D:\Serial.txt 无效。
DECLARE @itemID INT
DECLARE @AttachFile nvarchar(max)
SET @AttachFile = 'D:\Serial.txt'
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'sp_send_dbmail',
@recipients = '[email protected]',
@body = '查询结果在附件中',
@subject = '查询结果',
@body_format ='HTML',
@mailitem_id = @itemID OUTPUT,
@file_attachments = @AttachFile
print @itemID