Problema en MAIL con WebWrapper
Publicado por Daniel (10 intervenciones) el 07/12/2013 01:51:40
Hola a todos, tengo el siguiente problema con Genexus Evo 2, .NET y en SQL SERVER 2008:
- Estoy generando un mail creando un webWrapper, con el siguiente código:
&MailRecipient.Address = &EmpMail
&MailRecipient.Name = 'NombreEmpleado'
&Mail.To.Add(&MailRecipient)
// Información para conectarse al servidor SMTP.
&SMTPSession.Host = &HOST
&SMTPSession.UserName = &UserName
&SMTPSession.Password = &pass
&SMTPSession.Port = &port
&SMTPSession.Sender.Name = &Sender
&SMTPSession.Sender.Address = &AddresSender
&SMTPSession.Authentication = &Auth
&StatusSMTP = &SMTPSession.Login()
msg(&SMTPSession.ErrDescription)
if &StatusSMTP <> 0
Do 'ErrorSMTP'
endif
//Asunto del Correo
&Mail.Subject = 'Titulo del Mail'
//Cuerpo del Correo en Formato HTML
&webwrapper.Object = WrapperNotificacion.Create(&parm1, &parm2, &parm3)
&InfoContent = &webwrapper.GetResponse()
&Titulo = 'Titulo del cuerpo del mail'
&Mail.HTMLText = &InfoContent.Trim()//.Replace('403 Forbidden', &Titulo)
//Envío de correo
&StatusSMTP = &SMTPSession.Send(&Mail)
msg(&SMTPSession.ErrDescription)
if &StatusSMTP <> 0
&Error = &SMTPSession.ErrDescription
msg('Error '+str(&SMTPSession.ErrCode)+': '+&SMTPSession.ErrDescription)
endif
//Cierro conexion
&StatusSMTP = &SMTPSession.Logout()
msg(&SMTPSession.ErrDescription)
if &StatusSMTP <> 0
&Error = &SMTPSession.ErrDescription
msg('Error '+str(&SMTPSession.ErrCode)+': '+&SMTPSession.ErrDescription)
endif
- El problema consiste en que efectivamente manda el correo sin consecuencias pero cuando termina de mandar el correo, la página donde me encuentro me regresa en código como este:
{"gxProps":[{"CmpContext":"","IsMasterPage":"True","TABLE4_MPAGE":{"Visible":"0"},"FOURTHTEXT_MPAGE":{"Jsonclick":"confirm( '¿Realmente desea salir del sistema?')"}},{"CmpContext":"","IsMasterPage":"False","vCARGADO":... ETC
No me regresa la forma como debería. He intentado cambiar el objeto webWrapper como main, sin APPMasterPage pero no he tenido resultado favorable.
Lo unico que me ha funcionado es quitarle el &Mail.HTMLText = &InfoContent.Trim() solo así me deja la forma pero por obvias razones, el cuerpo del correo va en blanco, ¿ alguien tiene alguna duda que me pueda servir?
Desde ya, muchísimas gracias!
- Estoy generando un mail creando un webWrapper, con el siguiente código:
&MailRecipient.Address = &EmpMail
&MailRecipient.Name = 'NombreEmpleado'
&Mail.To.Add(&MailRecipient)
// Información para conectarse al servidor SMTP.
&SMTPSession.Host = &HOST
&SMTPSession.UserName = &UserName
&SMTPSession.Password = &pass
&SMTPSession.Port = &port
&SMTPSession.Sender.Name = &Sender
&SMTPSession.Sender.Address = &AddresSender
&SMTPSession.Authentication = &Auth
&StatusSMTP = &SMTPSession.Login()
msg(&SMTPSession.ErrDescription)
if &StatusSMTP <> 0
Do 'ErrorSMTP'
endif
//Asunto del Correo
&Mail.Subject = 'Titulo del Mail'
//Cuerpo del Correo en Formato HTML
&webwrapper.Object = WrapperNotificacion.Create(&parm1, &parm2, &parm3)
&InfoContent = &webwrapper.GetResponse()
&Titulo = 'Titulo del cuerpo del mail'
&Mail.HTMLText = &InfoContent.Trim()//.Replace('403 Forbidden', &Titulo)
//Envío de correo
&StatusSMTP = &SMTPSession.Send(&Mail)
msg(&SMTPSession.ErrDescription)
if &StatusSMTP <> 0
&Error = &SMTPSession.ErrDescription
msg('Error '+str(&SMTPSession.ErrCode)+': '+&SMTPSession.ErrDescription)
endif
//Cierro conexion
&StatusSMTP = &SMTPSession.Logout()
msg(&SMTPSession.ErrDescription)
if &StatusSMTP <> 0
&Error = &SMTPSession.ErrDescription
msg('Error '+str(&SMTPSession.ErrCode)+': '+&SMTPSession.ErrDescription)
endif
- El problema consiste en que efectivamente manda el correo sin consecuencias pero cuando termina de mandar el correo, la página donde me encuentro me regresa en código como este:
{"gxProps":[{"CmpContext":"","IsMasterPage":"True","TABLE4_MPAGE":{"Visible":"0"},"FOURTHTEXT_MPAGE":{"Jsonclick":"confirm( '¿Realmente desea salir del sistema?')"}},{"CmpContext":"","IsMasterPage":"False","vCARGADO":... ETC
No me regresa la forma como debería. He intentado cambiar el objeto webWrapper como main, sin APPMasterPage pero no he tenido resultado favorable.
Lo unico que me ha funcionado es quitarle el &Mail.HTMLText = &InfoContent.Trim() solo así me deja la forma pero por obvias razones, el cuerpo del correo va en blanco, ¿ alguien tiene alguna duda que me pueda servir?
Desde ya, muchísimas gracias!
Valora esta pregunta


0