Page 1 of 1

Email Settings Error

Posted: Mon Sep 21, 2009 3:44 pm
by DBounlom
I am getting the following error whenever I try to configure my email settings.

"Server configuration was updated but the test resulted in error: Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

1. SMTP Server: smtp.gmail.com
2. SMTP Port: 465 (I have tried 587 and even 993 as well)
3. Enable SSL: yes
4. SMTP Username: XXX
5. SMTP Password: XXX
6. Use Authentication: Yes

ASP.net is running under a medium trust environment. Does anyone know how to fix this problem? Thanks.

Re: Email Settings Error

Posted: Fri Sep 25, 2009 4:38 am
by mazhar
I haven't seen this sort or problem reported before, Google searches say problem seems to be some trust level issue where your host may be using custom level, SMTP requires medium level trust. You told that you are using medium level, are you sure about it. Did you asked your hosting provider about this, what they told you.

Re: Email Settings Error

Posted: Mon Sep 28, 2009 1:39 pm
by DBounlom
Dear Mazhar,

Thank you for writing back. The hosting company that we use fixed the problem for us, and this is how they explained the problem.

"The issue is related to the asp.net trust level being set to Medium Trust. System.Net.Mail requires Full Trust for ports
different than smtp port 25. This is the reason why System.Net.Mail generates security exceptions for 465, 587, 993.

We have set the port number to 25 and is working now. It seems that Google allows port 25 for connections trough smtp.gmail.com"

Even though on Google's SMTP setup configuration page, it does not list anything about port 25. However, we seem to be getting e-mail to work properly now. I hope this helps others if they have the same problem.

Re: Email Settings Error

Posted: Tue Sep 29, 2009 2:17 am
by mazhar
Sounds great, thanks for resolving the thread. I appreciate it.