Hi to all,
please is there someone that can test the below little program, to check if it works ?
I have problems only with LEGALMAIL (PEC) that at moment seems use the new TLS 1.2 protocol
Many many many tks for any help
Of course you have to use your own userid/password and email for LEGALMAIL
Romeo
********************************
** TEST PRG **
*
#include "FiveWin.ch"
*
*
function main
LOCAL oEmailMsg
LOCAL cSchema := "http://schemas.microsoft.com/cdo/configuration/sendtls/"
Local err:=.f.
memowrit(hb_curdrive()+":\"+curdir()+"\test.txt","File test attached")
oEmailMsg := CREATEOBJECT ( "CDO.Message" )
WITH OBJECT oEmailMsg
:From := "xxx1960@legagmail.it"
:To := "xxx1960@legagmail.it"
:CC :=""
:BCC :=""
:Subject := "Soggetto"
:TextBody := "Testo del messaggio"
:AddAttachment(hb_curdrive()+":\"+curdir()+"\test.txt" )
WITH OBJECT :configuration:Fields
:Item( cSchema + "smtpserver" ):Value := "sendm.cert.legalmail.it"
:Item( cSchema + "smtpserverport" ):Value := 465
:Item( cSchema + "sendusing" ):Value := 2
:Item( cSchema + "smtpauthenticate" ):Value := .T.
:Item( cSchema + "smtpusessl" ):Value := .T.
:Item( cSchema + "sendusername" ):Value := "xxx1960@legagmail.it"
:Item( cSchema + "sendpassword" ):Value := "Pippo"
:Item( cSchema + "smtpconnectiontimeout"):Value := 30
:Update()
END WITH
TRY
:Send()
CATCH
err:=.t.
END
END WITH
if err
msginfo("Error ")
else
msginfo("Not Errore !")
endif
return nil
*