SQL SENDMAIL help

  • Hi guys.

    I have a what appears to be a rather stupid and straightr forward problem. When trying to send a response of some action from my server via email, I wish to attach a file to the email(@attachments = 'c:\temp\test.txt',). When i send it without thos line the email works but with it I get this error:

    Error: @attachments file "c:\TEMP\test.txt" does not exist

    I have checked and the file does exist! Anyone have an idea

    Cheers

  • did you check for any spaces in the path(file path). SQL Server doesnot Like that. use some like this if you have spaces in your file path. c:\"program Files\Microsoft SQL".

  • Also... remember that the path and file name have to exist on the SQL server... so if you're creating them on your local machine they aren't on the SQL server's path.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Yeah no spaces in the file. We thot about the file not being on the server but that doesn't seem to be the solution. It is a puzler

  • Also check that the service that is trying to send the file has access to both the folder and file.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

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

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