Hi there I am working on a new ASP.NET MVC app. One action/page in particular automatically reads emails from my Winhost email address, using POP port 110 @ mail.[myWinhostdomain].com. When the ASP.NET app runs on my PC here at home, it can read emails fine from my Winhost email address. However when I deploy the ASP.NET to my Winhost site, the C# code cannot log in to the POP server. This is even with the exact same mail settings! I've also tried setting POP server to localhost. Is there any other port or POP server I should be using ? Many thanks, Sean
Security blocking attempt to open socket I had another go at POPing mail from within my web site. I swapped C#Mail and instead use OpenPop library. When OpenPOP tries to connect to my win host mail server, this exception occurs: Code: Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port) +748 OpenPOP.POP3.POPClient.Connect(String strHost, Int32 intPort, Boolean useSsl) +209 I've had a look around the IIS7 Manager - and can't see any settings for POP mail. My application seems to have Full Permissions. Wonder is there any way to POP mail from within a Winhost web site ?
Try increasing your applications trust level. By default it is set to Medium. You may want to try setting it to either High or Full. http://support.Winhost.com/KB/a657/changing-the-default-aspnet-trust-level.aspx
I've tried that - but still does not work. A workaround I have, is to use a Windows Service hosted on my own PC, that does the POPing and processes the emails.