ASP:NET PROBLEMA AL ENVIAR MAIL
Hola a todos, hace un tiempo ya que tengo este problema
estoy realizando una aplicacion web y necesito que al realizar una insercion debo enviar una mail.
bueno el codigo es lo siguiente
----------------------
Imports System.Web.Mail
Imports System.Web
Public Class EnviarMail
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Mensaje As New MailMessage()
Mensaje.To = "[email protected]"
Mensaje.From = "[email protected]"
Mensaje.Subject = "Mensaje de Prueba"
Mensaje.BodyFormat = MailFormat.Html
Mensaje.Body = "Esto es una prueba"
SmtpMail.Send(Mensaje)
Label1.Text = "Mensaje Enviado"
Mensaje = Nothing
End Sub
End Class
PERO ME SALE EL SIGUIENTE ERROR
Server Error in '/correo' Application.
--------------------------------------------------------------------------------
Biblioteca no registrada.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Biblioteca no registrada.
Source Error:
Line 35: 'Mensaje.Attachments.Add(oAttach)
Line 36: SmtpMail.SmtpServer.Insert(0, "127.0.0.1")
Line 37: SmtpMail.Send(Mensaje)
Line 38:
Line 39: Label1.Text = "Mensaje Enviado"
Source File: c:inetpubwwwrootcorreoEnviarMail.aspx.vb Line: 37
Stack Trace:
[COMException (0x8002801d): Biblioteca no registrada.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue) +87
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue) +139
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +107
System.Web.Mail.SmtpMail.Send(MailMessage message) +153
correo.EnviarMail.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootcorreoEnviarMail.aspx.vb:37
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
en mi consulta anterior me dieron un link http://systemwebmail.com
comprobe todas los posible errores que cometi pero no paso nada.
Opte por lo siguiente
1) desintalar el visual studio
2) instalar el framework 2.0 beta
luego instalar el Visual studio peor sigue el mismo error
luego intenete lo mismo 1) luego instale el framework 1.1.. pero no pasa nada
Si alguien sabe de algo lo prodrÃa publicar aqui por favor
salu2
.cl
estoy realizando una aplicacion web y necesito que al realizar una insercion debo enviar una mail.
bueno el codigo es lo siguiente
----------------------
Imports System.Web.Mail
Imports System.Web
Public Class EnviarMail
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Mensaje As New MailMessage()
Mensaje.To = "[email protected]"
Mensaje.From = "[email protected]"
Mensaje.Subject = "Mensaje de Prueba"
Mensaje.BodyFormat = MailFormat.Html
Mensaje.Body = "Esto es una prueba"
SmtpMail.Send(Mensaje)
Label1.Text = "Mensaje Enviado"
Mensaje = Nothing
End Sub
End Class
PERO ME SALE EL SIGUIENTE ERROR
Server Error in '/correo' Application.
--------------------------------------------------------------------------------
Biblioteca no registrada.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Biblioteca no registrada.
Source Error:
Line 35: 'Mensaje.Attachments.Add(oAttach)
Line 36: SmtpMail.SmtpServer.Insert(0, "127.0.0.1")
Line 37: SmtpMail.Send(Mensaje)
Line 38:
Line 39: Label1.Text = "Mensaje Enviado"
Source File: c:inetpubwwwrootcorreoEnviarMail.aspx.vb Line: 37
Stack Trace:
[COMException (0x8002801d): Biblioteca no registrada.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue) +87
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue) +139
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +107
System.Web.Mail.SmtpMail.Send(MailMessage message) +153
correo.EnviarMail.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootcorreoEnviarMail.aspx.vb:37
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
en mi consulta anterior me dieron un link http://systemwebmail.com
comprobe todas los posible errores que cometi pero no paso nada.
Opte por lo siguiente
1) desintalar el visual studio
2) instalar el framework 2.0 beta
luego instalar el Visual studio peor sigue el mismo error
luego intenete lo mismo 1) luego instale el framework 1.1.. pero no pasa nada
Si alguien sabe de algo lo prodrÃa publicar aqui por favor
salu2
.cl
