I am working to get a browser-enabled form to send an email in InfoPath. Currently, I've been trying to get it to work through Visual Studio Debugging, but I keep getting the same error:
Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
It happens when I try to declare a new SmtpClient inside FormEvents_Submit.
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
I've added a reference to System.Net & please note that I'm not currently trying to send from SharePoint or another Web site, it's all local right now.
Here's my full code:
string MySmtpMailServerName = "smtp.gmail.com";
int MySmtpMailServerPort = 587; //25 is the default for SMTP
MailMessage msg = new MailMessage(&quo
View Complete Post