Click here to Skip to main content
15,072,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a CLR that is in vb and is very basic:
It send out smtp emails and has one import:
Imports System.Net.Mail

I created the assemble successfully and I can run the CLR Code but when I do I get the following error message below:

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

What I have tried:

I am trying to load the assemble system.net.Mail but I can't find the dll anywhere

What dll clr should I load?
I am trying to keep the vb code with no references.
Posted
Updated 15-Nov-20 23:17pm
v4

1 solution

You'll need to create the CLR assembly with UNSAFE permissions to send email.

Creating an Assembly - SQL Server | Microsoft Docs[^]
   
v2
Comments
John Robert Connolly 16-Nov-20 7:38am
   
Thank yo for the quick response on this and for your answer. I was trying to avoid using UNSAFE permissions because that allows someone to gain access to the file system and other resources on the server. I thought this was a security vulnerability.
Again thank you for the response

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900