By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

URGENT * PLEASE - problem when sending mail - C# - Framework 1.1

P: n/a
Hey all,

I have a URGENT problem and I hope someone could help me...

scenery:
I have a windows app, coded using C# (framework 1.1 - VS2003)... The

exe and dlls of the app is are stored in a server, and the clients

access this app through a shortcut that points to this. The folder of

the app is shared on the network. This app accesses a oracle database.
I'm using system.web.mail namespace..

The users/clients can access the app with no problem, everything ok.

But when I try to send mails, I get an exception...

When I'm debuging the app and running it local, the e-mail is sent,

but when I copy it to the server and access the app through the

network, i get the error...

So here are my question:

- What's the name given to this programming model (user/client

accessing exes on a server)?
- What are the requirements to accomplish this task according to this

programming model?
- Do the client pcs need something special to send the mail?

Thanks for your help and sorry for poor english.
Jul 22 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The exception should give you some clues as to what the problem is. You
don't say if you're accessing the app on a mapped drive or a UNC share, but
I suspect it's a security issue where either the runtime is not letting you
access network resources because you launched it remotely, or your
application is trying to load an associated dll from the server folder and
being denied access.

I suggest either
a) mapping a drive to access the executable over, rather than a UNC network
path, or if that doesn't work
b) redeploy your application on your webserver directly and migrate the app
to call a web service on the originating server to send the mail

Leon

"Férnas" <ga*****@wideweb.com.brwrote in message
news:c2**********************************@d77g2000 hsb.googlegroups.com...
Hey all,

I have a URGENT problem and I hope someone could help me...

scenery:
I have a windows app, coded using C# (framework 1.1 - VS2003)... The

exe and dlls of the app is are stored in a server, and the clients

access this app through a shortcut that points to this. The folder of

the app is shared on the network. This app accesses a oracle database.
I'm using system.web.mail namespace..

The users/clients can access the app with no problem, everything ok.

But when I try to send mails, I get an exception...

When I'm debuging the app and running it local, the e-mail is sent,

but when I copy it to the server and access the app through the

network, i get the error...

So here are my question:

- What's the name given to this programming model (user/client

accessing exes on a server)?
- What are the requirements to accomplish this task according to this

programming model?
- Do the client pcs need something special to send the mail?

Thanks for your help and sorry for poor english.
Jul 22 '08 #2

P: n/a
It does really look like a Code Access Security problem, since the
application runs correctly from the local PC but fails when run from the
server, which by default would give it greatly reduced permissions.

The text of the exception should give you more detailed information about
exactly which permission you are missing. As a test, I would suggest that
you go to the Administrative Tools in Control Panel and use the .NET
Framework Configuration tool to assign Full Trust to your assemblies (the
..exe and dll's of your program). If the program runs correctly under Full
Trust (it should) you can then trim down the permissions until you grant the
minimum needed.

Once you have established a correct security configuration, you can then use
the same .NET Framework Configuration tool to generate a .msi that will set
those permissions when run in any other computer. You will have to
distribute and execute the .msi on all the computers in your network that
require access to the application that you are sharing in your server. You
can, for instance, set a policy that says "grant Full Trust to all
assemblies loaded from Server X", or "grant Full Trust to all assemblies
signed with this Key" (and sign with that key your deployed assemblies).

"Férnas" <ga*****@wideweb.com.brwrote in message
news:c2**********************************@d77g2000 hsb.googlegroups.com...
Hey all,

I have a URGENT problem and I hope someone could help me...

scenery:
I have a windows app, coded using C# (framework 1.1 - VS2003)... The

exe and dlls of the app is are stored in a server, and the clients

access this app through a shortcut that points to this. The folder of

the app is shared on the network. This app accesses a oracle database.
I'm using system.web.mail namespace..

The users/clients can access the app with no problem, everything ok.

But when I try to send mails, I get an exception...

When I'm debuging the app and running it local, the e-mail is sent,

but when I copy it to the server and access the app through the

network, i get the error...

So here are my question:

- What's the name given to this programming model (user/client

accessing exes on a server)?
- What are the requirements to accomplish this task according to this

programming model?
- Do the client pcs need something special to send the mail?

Thanks for your help and sorry for poor english.

Jul 22 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.