When you run things in the debugger, the project is using your credentials to access things.
The problem is that your app pool (IIS) identity is responsible for performing the actions defined in your published project. By default this is network service, which doesn't have rights to touch other area of your filesystem. External systems would see it as an anonymous user. If both systems are in the same domain, it will have slightly greater privileges, but not much more.
The typical solution is to create a basic user account on your IIS server (or a basic domain account), use the aspnet_regiis -ga username to make it capable of running ASP.NET code, and change your App Pool's identity to the new account.
Give this new account appropriate filesystem rights to wherever it needs access.
I'm a bit unsure of any special requirements for using mapped drives. The easiest way to verify would be to logon to your IIS server using the new account, and confirm that you can map the drive. If it proves to be too much hassle, switch to using a UNC path \\server\sharename
This technique will also make it easier to secure your access to SQL as you can use a Windows account for access to your database and avoid storing username/password info in your publication settings.
Another alternative is to setup an FTP server and use FTP components to access the remote filesystem.