July 23, 2010 at 2:45 am
Hi,
i'm trying to send an email to myself (internal ) and also to someone external of the company.
I want to send an attachment and i've been looking at the following link but when i try it says
'attachment file https://mysite.com/documents/2000/docname.pdf is invalid'
i've copied and paste the file name into my browser and it definetely points to a document.
declare @subjectline varchar(100) = 'test subject',
@newbody varchar(100) = 'testbody',
@myattachment varchar(max) = 'https://mysite.com/documents/2000/docname.pdf'
,@hc int
--the below is a call to my stored procedure which in turn calls the send_dbmail stored procedure
EXEC sp_Sys_SendMail_attachment 'myemailaddress@me.com',@subjectLine,@NewBody,
@attachment = @myattachment,
@RetVal = @hc OUTPUT
http://technet.microsoft.com/en-us/library/ms190307.aspx
can anyone see what i'm doing wrong?
thanks
July 23, 2010 at 4:21 am
This was removed by the editor as SPAM
July 23, 2010 at 4:58 am
i had not seen anyone try that before...getting a file from an url.
I'm awful sure the retrieving of an attachment is a file operation only, and the file must exist on the server or on a network share the server can access...i don't think the sp_send_mail will download a remote file and then attach it.
am i right?
http://technet.microsoft.com/en-us/library/ms190307.aspx
[ @file_attachments= ] 'file_attachments'Is a semicolon-delimited list of file names to attach to the e-mail message. Files in the list must be specified as absolute paths. The attachments list is of type nvarchar(max). By default, Database Mail limits file attachments to 1 MB per file. For more information, see Database Mail Configuration Wizard.
Lowell
July 23, 2010 at 6:13 am
I think you must be right.
i ended up with the following:
declare @subjectline varchar(100) = 'test subject',
@newbody varchar(100) = 'testbody',
@myattachment varchar(max) = '//server/folder/2000/docname.pdf'
,@hc int
--the below is a call to my stored procedure which in turn calls the send_dbmail stored procedure
EXEC sp_Sys_SendMail_attachment 'myemailaddress@me.com',@subjectLine,@NewBody,
@attachment = @myattachment,
@RetVal = @hc OUTPUT
thanks 😎
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply