Email con gmail

Al conectarte con gmail mediante EmailStartSMTPSession puede que te de algun error al configurar el certificado TLS

La solución está en usar:

EmailConfigure(emailParameterMode, 1)

antes del EmailStartSMTPSession

El problema es que esta función sólo está en la 22

Ejemplo de crear fichero en XML

Objetivo:

Código:

sMidoc is string = "XML"
sMiinfo is string
XmlDocument(sMidoc," ") //Creates a sMidoc XML in memory

XMLAddChild(sMidoc,"FacturaElectronica"," ", True) //Creates the Root Level, see the "True" parameter
XMLAddChild(sMidoc,"Clave","12345key") //Creates an element under the Root level
XMLAddChild(sMidoc,"NumeroConsecutivo","0100001") //Creates an Element under the Root level

XMLAddChild(sMidoc,"Emisor","",True) //Creates a new "Emisor" Level under the root level (True Parameter)
XMLAddChild(sMidoc,"Nombre","Nombre de mi empresa") //Creates an element under Emisor

XMLAddChild(sMidoc,"Identificacion"," ", True) //Creates a new "Identificacion" Sublevel under "Emisor" level (True parameter)
XMLAddChild(sMidoc,"Tipo","01") //Creates an Element "Tipo" under "Identificacion" Sublevel
XMLAddChild(sMidoc,"Numero","3101347822") //Creates an Element "Numero" under "Identificacion" Sublevel
XMLParent(sMidoc) //Up one level, now we are on the "Emisor" level again

XMLAddChild(sMidoc,"Ubicacion"," ",True) //Creates a new "Ubicación" sublevel under "Emisor" Level (True parameter)
XMLAddChild(sMidoc,"Provincia","Heredia") //Creates an Element "Provincia" under "Ubicacion" sublevel
XMLAddChild(sMidoc,"Canton","Santo Domingo") //Creates an Element "Canton" under "Ubicacion" sublevel
XMLAddChild(sMidoc,"Distrito","Santo Tomas") //Creates an Element "Distrito" under "Ubicacion" sublevel
XMLParent(sMidoc) //Up one level, now we are on the "Emisor" level again


//Now the fun part

XMLAddChild(sMidoc,"DetalleServicio"," ",True) //Creates a new "DetalleServicio" Level same level as "Emisor"
XMLAddChild(sMidoc,"LineaDetalle"," ",True) //Creates a new "LineaDetalle" sublevel under "DetalleServicio" Level

poslineas is int = garrdetfac..Occurrence
FOR i=1 TO poslineas
XMLAddChild(sMidoc,"NumeroLinea" ,NumToString(i)) //Element "NumeroLinea" under "LineaDetalle" Sublevel

XMLAddChild(sMidoc,"Codigo","" ,True) //Creates a "Codigo" Sublevel under "NumeroLinea" Level
XMLAddChild(sMidoc,"Tipo" ,"04") //Element "Tipo" of "Codigo" Sublevel
XMLAddChild(sMidoc,"Codigo" ,"004") //Element "Codigo" of "Codigo" Sublevel
XMLParent(sMidoc) //Up one level, now we are on the "LineaDetalle" Sublevel

XMLAddChild(sMidoc,"Cantidad" ,3) //Element "Cantidad" under "LineaDetalle" Sublevel
XMLAddChild(sMidoc,"Monto" ,1525.00) //Element "Monto" under "LineaDetalle" Sublevel
END
XMLParent(sMidoc) //Up one level, now we are on the "LineaDetalle" Sublevel
XMLParent(sMidoc) //Up one level, now we are on the "DetalleServicio" level
XMLParent(sMidoc) //Up one level, now we are on the Root level

sMiinfo = XMLBuildString(sMidoc,XMLDocumentDefault,XMLEncodingUTF8)
XMLClose(sMidoc)
fSaveText("C:\Users\Desktop\Mixmlayuda.xml",sMiinfo) //Done