xp_smtp_sendmail with attachment on netweork

  • Hi,

    I tried to send an email with attachment on network drive by using SQL 2000 xp_smtp_sendmail and got an cannot find the file error. I was able to open the file after cut and paste the full drive and filename through IE. Is there an extra step I have to do before sending the attachment on remote server? Thanks.

    Chris

  • The cannot find file error usually either means that the file does not exist, or that access is denied.  Check the folder and file permissions on the attachment and make sure that the account that the xp_smtp_sendmail request is running under has access to that folder.  Just curious, but re you using the UNC name or a mapped drive letter name to reference the attachment?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Hi John,

    Thanks for helping out. I was using the UNC \\servername\xxxx\yyy. I was able to open file from IE by using the link though. I created the file from one of my DTS job. The file is on different server than the SQL.

    Chris

  • In what context is xp_smtp_sendmail running? SPROC, DTS, SQLAgent?  Is your SQL Server service running under a domain account or local system?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • The file was created inside DTS job. DTS also calls a stored procedure which fires xp_smtp_sendmail. SQL server is a domain account.

  • What about your SMTP server, is it your local SQL Server?  Check and see what account the SMTP service is running under. 

    I had this same problem not long ago, but opted to keep the attachment local to the SQL Server (which was also the SMTP server).  I then moved the file to a remote server for archive purposes.  Since I never 'solved' the problem, I may not be the best of help here, but now that I've had more of a chance to think about it, I would suggest checking the SMTP service account. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Hi John,

    SMTP is on remote server. I figured it out now. The file was sitting on public server. However, the sub-folder is a private one. I have the access but not the SQL server. So SQL server had trouble to write on it.

    Again thanks, John.

    Chris

Viewing 7 posts - 1 through 6 (of 6 total)

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