IF THIS.Enabled=.T. THEN
THISFORM.MOUSEPOINTER=11
nrespuesta=0
mensaje="¿ Deseas Enviar En Este Momento El Email ? "
DO confirma WITH mensaje
IF nrespuesta=6 THEN
linternet=.F.
=haywww()
IF linternet=.T. THEN
TRY
LOCAL lcSchema, loConfig, loMsg, loError, lcErr
loConfig=CREATEOBJECT("CDO.Configuration")
WITH loConfig.FIELDS
.ITEM(lcSchema+"smtpserver") =ALLTRIM(sucursal.smtpserver)
.ITEM(lcSchema+"smtpserverport") =sucursal.smtpport
.ITEM(lcSchema+"sendusing") =sucursal.sendusing
.ITEM(lcSchema+"smtpauthenticate")=sucursal.smtpauthen
.ITEM(lcSchema+"smtpusessl") =sucursal.smtpusessl
.ITEM(lcSchema+"sendusername") =ALLTRIM(sucursal.username)
.ITEM(lcSchema+"sendpassword") =ALLTRIM(sucursal.password)
.UPDATE()
ENDWITH
loMsg=CREATEOBJECT("CDO.Message")
WITH loMsg
.Configuration=loConfig
.FROM=ALLTRIM(sucursal.username)
.TO=ThisForm.para.Value
IF INT(LEN(ALLTRIM(THISFORM.cc.Value)))>7 THEN
.CC=THISFORM.cc.Value
ENDIF
.Subject=ThisForm.asunto.Value
.htmlbody="<p><b>"+ALLTRIM(THISFORM.mensaje.VALUE)+"</b></p>"
IF INT(LEN(ALLTRIM(sucursal.logoemail)))>0 AND FILE(ALLTRIM(sucursal.logoemail)) THEN
loBP=.AddRelatedBodyPart(ALLTRIM(sucursal.logoemail), "id_imagen10", 1)
WITH loBP.Fields
.Item("urn:schemas:mailheader:Content-ID")="id_imagen10"
.Update
ENDWITH
ENDIF
IF ThisForm.adjuntar.ListCount>0 THEN
FOR I=1 TO THISFORM.adjuntar.ListCount
.addAttachment(THISFORM.adjuntar.List(I))
ENDFOR
ENDIF
ENDWITH
loMsg.Send()
CATCH TO loError
lcErr=[Error: ]+STR(loError.ERRORNO)+CHR(13)+[Linea: ]+STR(loError.LINENO)+CHR(13)+[Mensaje: ]+loError.MESSAGE
FINALLY
MOUSEPOINTER=0
IF ! EMPTY(lcErr) THEN
MESSAGEBOX(lcErr, 16, "Mensaje.")
ENDIF
RELEASE lcSchema, loConfig, loMsg, loError, lcErr
ENDTRY
THISFORM.MOUSEPOINTER=0
SET TALK ON
RELEASE email
RELEASE THISFORM
ELSE
THISFORM.MOUSEPOINTER=0
MESSAGEBOX('Error; No Hay Servicio De Banda Ancha O Internet, Re-Intente De Nuevo.', 16, 'Mensaje.')
ThisForm.para.SetFocus()
ENDIF
ELSE
THISFORM.MOUSEPOINTER=0
ThisForm.para.SetFocus()
ENDIF
ENDIF
salds.....