none
"Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed"

    Question

  • I have created an app in VS 2008 c# to use in sharepoint, that sends a couple of basic emails. I first created a console app to test it, it worked fine, using the our companys SMTP server to send the emails, the emails were sent successfully.

    After seeing that it worked correctly, I put this code behind a button in Infopath forms and I get this error: Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    I don't understand why this worked correctly in console app and not behind the infopath button, do I have to give permissions in Infopath? I shouldnt have to configure settings on the server, because it worked with my console app. I have the app running on my localhost, its not hosted elsewhere. And as Im sure you know, code behind a button is developed using VSTA (visual studio tools for applications). I am fairly new to coding, so if you can, please be explicit. Thanks in advance!

    Moderators: Would this question be served better in a diiferent forum? Wasnt sure where to put it.Thanks
    • Edited by Mike Walsh FIN Thursday, November 26, 2009 6:47 AM Prefix removed
    • Moved by Mike Walsh FIN Thursday, November 26, 2009 6:49 AM InfoPath q (From:SharePoint - Development and Programming)
    Wednesday, November 25, 2009 4:53 PM

Answers

All replies