Quantcast
Channel: SQL.ru: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 7251

sp_send_dbmail attachment unc-path

$
0
0
Добры вечер. Подскажите как можно выслать письмо с файлам взятым с удаленного сервера:
DECLARE @mailitem_id INT,
        @retcode INT;

EXECUTE @retcode = msdb.dbo.sp_send_dbmail @profile_name = 'mail',
                                           @recipients = 'test@test.com',
                                           @subject = 'subj',
                                           @body = 'body',
                                           @body_format = 'HTML',
                                           @file_attachments = '\\192.168.20.21\Shared Files\Reports\test.pdf',
                                           @mailitem_id = @mailitem_id OUTPUT;


SELECT @retcode,
       @@error;

Получаю ошибку: Attachment file \\192.168.20.21\Shared Files\Reports\test.pdf is invalid.

Viewing all articles
Browse latest Browse all 7251

Trending Articles