fchirico
Member
Estimados,
Desde una App estoy enviando un mail, en el cuerpo envío el detalle del pedido de ventas cargado.
Quiero constuir el cuerpo del mail utilizando HTML para que quede más estético (así lo hago en otros lenguajes) pero en B4A me pega el contenido "literal" de la variable en vez de interpretar el código HTML correspondiente.
Adjunto la rutina de envío del mail:
Por favor me podrían decir qué estoy haciendo mal o qué me falta?
Muchas gracias!
Desde una App estoy enviando un mail, en el cuerpo envío el detalle del pedido de ventas cargado.
Quiero constuir el cuerpo del mail utilizando HTML para que quede más estético (así lo hago en otros lenguajes) pero en B4A me pega el contenido "literal" de la variable en vez de interpretar el código HTML correspondiente.
Adjunto la rutina de envío del mail:
B4X:
Sub EnviarCorreoDeConfirmacion
Dim cEncab As String
Dim cBody = " " As String
Dim i As Int
Dim cMsg As String
cEncab = $"
<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Arimex Importadora S.A.</title>
</head>
<body>
<h1>Su pedido: ${cNumPed} Sucursal: ${Main.cSucursal} </h1>
<h1>Fecha: ${Main.cFecha} </h1>
<h1>Cliente: ${lbl_NomCli.text} - ${lbl_CodCli.text}/${lbl_LojaCli.text} </h1>
<h1>Vendedor: ${lbl_CodVen.text} - Usuario GA.MA Tools: ${Main.cUSR_usuario} </h1>
<h1>Canal: ${cCanal} Condición de Pago: ${edt_CondPa.text} Dto.Global: ${lbl_DtoG01.text}</h1>
<h1>Dirección de Entrega: ${edt_DirEntre.text} </h1>
<h1>Mensaje para Factura: ${edt_MensajeFac.text} </h1>
<table>
<tr>
<th scope="col">Producto</th>
<th scope="col">Nombre producto</th>
<th scope="col">Precio unitario</th>
<th scope="col">Unidades</th>
<th scope="col">Dto.de Linea</th>
</tr>"$
For i = 0 To nIndiceLineaPedido - 1
If User4(i).LinPed_Cantidad > 0 Then
cBody = cBody & $"<tr>
<td>${User4(i).LinPed_CodProd}</td>
<td>${User4(i).LinPed_DescriPro}</td>
<td>${User4(i).LinPed_Precio}</td>
<td>${User4(i).LinPed_Cantidad}</td>
<td>${User4(i).LinPed_DtoLin} </td>
</tr>"$
End If
Next
cEncab = cEncab & cBody & $"</table> </body> </html>"$
' cBody = $"Felicitaciones!
'
' Se ha generado el pedido ${cNumPed} en la sucursal: ${Main.cSucursal} existosamente.
'
' Fecha: ${Main.cFecha}
'
' Cliente: ${lbl_NomCli.text}
' ${lbl_CodCli.text}/${lbl_LojaCli.text}
'
' Vendedor: ${lbl_CodVen.text} Usuario GA.MA Tools: ${Main.cUSR_usuario}
' Canal: ${cCanal} Condición de Pago: ${edt_CondPa.text} Dto.Global: ${lbl_DtoG01.text}
'
' Dirección de Entrega: ${edt_DirEntre.text}
' Mensaje para Factura: ${edt_MensajeFac.text}
'
' "$
'
' For i = 0 To nIndiceLineaPedido - 1
' If User4(i).LinPed_Cantidad > 0 Then
' cBody2 = cBody2 & $"
' Prod.: ${User4(i).LinPed_CodProd} / ${User4(i).LinPed_DescriPro} Cant.: ${User4(i).LinPed_Cantidad} Precio s/dto.: ${User4(i).LinPed_Precio} Dto.de Linea: ${User4(i).LinPed_DtoLin}
' "$
' End If
' Next
'
' cBody = cBody & cBody2
Main.sendmail.Send(Main.cUSR_email,File.DirInternal, cEncab, "GA.MA Tools - Pedido generado: " & cNumPed & " (" & Main.cEntorno & ")", "")
End Sub
Por favor me podrían decir qué estoy haciendo mal o qué me falta?
Muchas gracias!