36 messaggi dal 30 luglio 2004
Mi sapete dire perchè inviando una mail dal server mi da questo errore??

Dim objMail As New MailMessage()


' allego il file
objMail.Attachments.Add(New MailAttachment(Server.MapPath(nomefile)))

objMail.From = "andrl@tiscali.it"
objMail.To = "andrl@tiscali.it"
objMail.Subject = "Stampe"
objMail.Body = "Stampe www.sanzioniweb.com"

SmtpMail.SmtpServer = "smtp.tiscali.it"
SmtpMail.Send(objMail)

ERRORE:


Server Error in '/' Application.
--------------------------------------------------------------------------------

Security Exception
Description: 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.

Exception Details: System.Security.SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +905
PuntosanzioniWEB._Default.Button5_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\PuntosanzioniWEB\reg\DEMO\Default.aspx.vb:412
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +2112
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
objMail.Attachments.Add(New MailAttachment(Server.MapPath(nomefile)))


Potrei dire una fesseria, ma hai verificato se l'account asp.net sulla tua macchina ha il permesso di lettura sul percorso?

Nicola Baldi
"Make things as simple as possible, but not simpler."
>>> My blog <<<
36 messaggi dal 30 luglio 2004
Si ho il permesso di lettura e scrittura sulla cartella.

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.