Impersonation doesn't help.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It seems I got stuck with interesting problem.
I'm trying to send email using System.Web.Mail and connecting to my mail on different server (not IIS Smtp Server).

Now my problem is, if I run my code in winforms application it works perfectly, but if i put exactly same code into my web application it gives me error saying it cant connect to server.

Now I thought if i impersonate account im logged in as, it would fix my problem, by using System.Security.Principal.WindowsIdentity.GetCurrent.Name i can see that my web application impersonated my account just fine, but it still hasnt fixed my problem.

Please can someone direct me where is my problem?

Best regards,
Dmitri.
 
Be sure that you use delegatable protocol. Check into your codebehind the
type of authentification. If this type is equal to NTLM than it the core of
your problem. NTLM does not support delegation.
Only Kerberos and Basic Auth.
Dmitri said:
It seems I got stuck with interesting problem.
I'm trying to send email using System.Web.Mail and connecting to my mail
on different server (not IIS Smtp Server).
Now my problem is, if I run my code in winforms application it works
perfectly, but if i put exactly same code into my web application it gives
me error saying it cant connect to server.
Now I thought if i impersonate account im logged in as, it would fix my
problem, by using System.Security.Principal.WindowsIdentity.GetCurrent.Name
i can see that my web application impersonated my account just fine, but it
still hasnt fixed my problem.
 
Hi, Yuri.
Thanks for reply.

How would I check what protocol am I using?

I do use this method for authentication:
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, True)

Could that cause problem?

Best regards,
Dmitri Lipski.
 
Back
Top