Smtp mail problem at Winhost (solved)

Written by stevey on June 28th, 2011

When I tried to send email from my main site hosted at Winhost.com, I got this permission error: “Request for the permission of type ‘System.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed..”. Winhost support forum has responded to this problem and suggested adding “<trust level=”Full”> under the <system.web> in web.config. I did that and the problem went away.

Thanks to folks at winhost support forum, I was also able to call Winhost smtp client, using Network credentials given to my hosting account, directly from my development local machine and sent email out by port 587. This sample code at Winhost KB was the right place to get start with Winhost smtp mail: http://support.winhost.com/KB/a650/how-to-send-email-in-aspnet.aspx.

 

3 Comments so far ↓

  1. Rolly says:

    I keep getting an error when sending an email via smtp from my local machine, stating that I can’t connect to the server. Do they need to enable or something before we can use the smtp server?

    Thanks in advance.

    • stevey says:

      I just tried to connect to their Smtp server from my local machine and this time it did not work; looks like either they have patched the hole or because I have a Windows 7 machine now and that requires configuring certain port to allow the connection. It worked when I was on a Windows 2003 server machine but it could be at that time, Winhost did not block port 587 from remote client.

      I always have problem using smtp from local machine and I guess Windows security does not allow; if you are using smtp server from your company and still could not connect, in most cases, it could be that the default port 25 is in use by virus scanning software.

      I will update my blog if I find some more useful info.

      steve

  2. Brian says:

    Thank you. This was helpful

Reply to Brian