Make sure your file is set to : Web.Config trust level full
<configuration>
<system.web>
.....
<trust level="Full" originUrl=""/>
</system.web>
</configuration>
For example, if you use GoDaddy, you should set the following in a variable (e.g. * smtp *): System.Net.Mail.SmtpClient
SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);
smtp.EnableSsl = false;
You will also need to follow this page here in order to properly set up email on . GoDaddy
, full trust, SMTP-. 80, 25, 80 .