April 4, 2007 at 12:17 pm
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
April 4, 2007 at 2:55 pm
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?
April 4, 2007 at 3:06 pm
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
April 4, 2007 at 3:11 pm
In what context is xp_smtp_sendmail running? SPROC, DTS, SQLAgent? Is your SQL Server service running under a domain account or local system?
April 4, 2007 at 3:15 pm
The file was created inside DTS job. DTS also calls a stored procedure which fires xp_smtp_sendmail. SQL server is a domain account.
April 4, 2007 at 3:37 pm
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.
April 5, 2007 at 12:04 pm
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