SmtpClient and user rights

  • Thread starter Thread starter leanerOfThat
  • Start date Start date
L

leanerOfThat

Hello,
I am working on a Windows application in .NET 2.0 that will send
emails. I have removed my account from the administrator group to put
it in the user group. When I run my application and try to send an
email, I get a time out exception. When I run my application as an
administrator, the email is sent without any problem. It seems that a
permission issue is at play here. I have looked around but found
nothing about that issue. Does anyone have any idea about what is
exactly going on? I could use any advice.
Thank you in advance.
 
Hola Carlos,
I am using .NET 2.0 so the class is actually
System.Net.Mail.SmtpClient. I can use a System.Net.NetworkCredential
set to an account with higher privileges and the mail will go through.

For example, if my account has the provileges of a simple user account
and I set the property UseDefaultCredentials to true, the SmtpClient
times out. If I run the application as an administrator, the email goes
through. If in my code I create a NetworkCredential object with the
login and password of my simple user the email will go through.

The problem I have is that I do not know any user in the target network
so I cannot create a NetworkCredential object. I should use the
UseDefaultCredentials = true...But it does not work with simple user.
I do not want an administrative account only situation for my
application as this is less than proper I think.

So...Did I miss something or there is no other way beside getting a
privileged account?

Thanks,
Pierre
 
Not sure about .NET 2.0, but with .NET 1.1 I think to remember that I have
sent e-mails with a non-admin account on my laptop at home (at office I am
admin user)...

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Back
Top