I have a stored procedure running on our data server that uses database mail to send out emails with attachments. The problem i have is that the file to be attached is on our webserver.
if i map drives between boxes and use this new path or if i use the IP of the webserver the proc always returns the error attachment file is invalid but if i manually copy the file to the data server and then quote a local path it is fine.
I know all paths I use are correct - is there an issue with Procs accessing remote files? An example of my code is
DECLARE @FILENAME AS VARCHAR(255)
SET @FILENAME = N'z:\'+ @LOANREF +'-MA.PDF'
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'DominoMail',
@recipients = "me@me.com",
@subject = @SUBJECT,
@file_attachments = @FileName,
@body = @tableHTML,
@body_format = 'HTML';
if i map drives between boxes and use this new path or if i use the IP of the webserver the proc always returns the error attachment file is invalid but if i manually copy the file to the data server and then quote a local path it is fine.
I know all paths I use are correct - is there an issue with Procs accessing remote files? An example of my code is
DECLARE @FILENAME AS VARCHAR(255)
SET @FILENAME = N'z:\'+ @LOANREF +'-MA.PDF'
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'DominoMail',
@recipients = "me@me.com",
@subject = @SUBJECT,
@file_attachments = @FileName,
@body = @tableHTML,
@body_format = 'HTML';