sp_db_sendmail error

0

I am currently running SQL Server 2014 and trying to execute a stored procedure that sends out an email using sp_db_sendmail which is failing with the following error.

An error occurred in the Microsoft .NET Framework while trying to load assembly id 65549. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error: System.IO.FileLoadException: Could not load file or assembly 'sqlwebrequest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A) System.IO.FileLoadException:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString)

Originally the sp_db_sendmail was working but since moving the database that calls the code to a new server I am getting the above message.

I have made the owner of the database the same as it was on the original server "sa" and also set the database to be "Trustworthy" which seems according to relevant googling should fix the problem, but still no luck.

Any further suggestion would be appreciated.

tsql
sql-server-2014
sp-send-dbmail
asked on Stack Overflow Mar 21, 2018 by PJD • edited Mar 21, 2018 by a_horse_with_no_name

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0