Security Exception when creating object

From: Jeff (
Date: 04/04/04

Date: 3 Apr 2004 17:17:21 -0800


I am deploying my web application to a new host site and am having
problems setting up the email. The site does not support ASP.NET

There is an .asp file that works correctly with the following code:

set smtp = Server.CreateObject("Bamboo.SMTP")

I am trying to migrate this to the vb code behind (aspx). Since the
set statement is not supported, I tried the following code

Dim smtp as object
smtp = Server.CreateObject("Bamboo.SMTP")

This caused a security exception (The application attempted to perform
an operation not allowed by the security policy. To grant this
application the required permission please contact your system
administrator or change the application's trust level in the
configuration file.)

I modified the web.config with:

    <trust level="Medium" />

but the site administrator has locked access to this section using
<location allowOverride="false"> from an inherited configuration file.
 I also tried <identity impersonate="true"/> with same results.

I then tried
           Dim smtpType = Type.GetTypeFromProgID("Bamboo.SMTP")
but this gets a security exception too.

I have considered leaving the functionality in the asp file, but would
rather not.

Is there a solution to this?

Thanks for any help!