SQL mail attachments

  • When using the '@attachments' parm in xp_sendmail, I assume the attached file has to be on the database server.  Is that correct? 

    Does anyone know if you can refer to a file on another server?

  • It needs to be readable by the service account, so if it's on a UNC share, permissions should be granted to the SQL Server service account.

  • Thanks for the response.  I'm trying to test this.  I created the share on the other machine and gave permissions on it to the service acct that's running SQL.  Then on the SQL machine a mapped a drive to that share.

    Now when I try the xp_sendmail with @attachments referring to the share and a test.txt file I get

    Server: Msg 18025, Level 16, State 1, Line 0

    xp_sendmail: failed with mail error 0x80004005

    This http://support.microsoft.com/default.aspx?scid=kb;en-us;274330&Product=sql2k says the problem is that the attached file is open, but the file is not open.  Any ideas?  Thanks

     

  • Now I got it to work.  The problem had nothing to do with an open file.  In the @attachments parm you have to refer to the share in UNC format like \\<servername>\<sharename>\<filename>. 

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply