April 11, 2008 at 10:56 am
I have been very happy with Database Mail in SQL Server 2005. It is SO much better than the old SQL Mail. However, I'm running into a problem with attachments that I'm hoping someone can help with.
Our production environment has two servers: a DB server running SQL Server 2005 and an application server running Windows Server 2003/IIS 6. I want to use the Database Mail on the DB server to send emails from the application (which is in classic ASP). Everything works perfectly until I try to attach a file that sits on the app server, and I receive the following error:
Msg 22051, Level 16, State 1, Line 0
Attachment file [file name] is invalid.
I've read everything I can find about this error, and I'm 100% sure the path is correct. According to my network guy, the proper users have the proper permissions. After talking to him, I think the problem may be the network configuration. The two servers are in the same subnet but not the same domain. Has anyone run into this? Is there a way to make DB mail work in this situation?
Thanks in advance for any tips you can give me.
Jeannine
April 11, 2008 at 11:45 am
When database mail sends an email with an attachment, it finds the attachment in the absolute path specified. This path is relative to the SQL Server, not to the calling client - so if you are specifying the C drive, it looks at the C drive on the SQL server, not the application server.
I think it accepts UNC - which is probably the best solution. Otherwise you may have to write your files to a UNC path from your application server and use a folder on the SQL server. To acces the folder, the SQL Server service account will need access (by default) or you will have to configure a delegate.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply