Ora viene compilata correttamente ma quando invio una mail mi restituisce sempre .f.
Ho creato un account di prova per fare i test e funziona correttamente con outlook.
Ho dimenticato qualcosa secondo te ?
------
#include "Fivewin.ch"
STATIC hLib
function invia()
cFrom:="
customers@softwarexp.co.uk"
cServer:="mail.softwarexp.co.uk"
cTo:="
m.turco@softwarexp.co.uk"
cSubjeCt:="Richiesta di assistenza"
cMessage:="Problema generale di contabilit…"
cSender:="Studio amministrativo"
cUser:="
customers@softwarexp.co.uk"
cPassword:="diamante71"
i:=SENDMAIL( cFrom, cServer, cTo, cSubject, cMessage, {}, cSender, cUser, cPassword)
msginfo(i)
return
FUNCTION SENDMAIL( cFrom, cServer, cTo, cSubject, cMessage, aAttach, cSender, cUser, cPassword, aCc, lHtml, cPort )
LOCAL cMsgFile := CTEMPFILE()
LOCAL cCmd := "SndMail -f " + cFrom + " -X " + cServer + " -r " + cTo + " -s " + ["] + cSubject + ["] + " -b " + cMsgFile
LOCAL nRes
LOCAL i
DEFAULT lHtml := .F.
IF !EMPTY( aAttach )
FOR i = 1 TO LEN( aAttach )
cCmd += " -a " + ["] + aAttach[ i ] + ["]
NEXT
ENDIF
IF !EMPTY( cSender )
cCmd += " -F " + ["] + cSender + ["]
ENDIF
IF !EMPTY( cUser )
cCmd += " -h LOGIN -u " + cUser
ENDIF
IF !EMPTY( cPassword )
cCmd += " -p " + cPassword
ENDIF
IF !EMPTY( aCc )
FOR i = 1 TO LEN( aCc )
cCmd += " -c " + ["] + aCc[ i ] + ["]
NEXT
ENDIF
IF lHtml
cCmd += " -H"
ENDIF
IF !EMPTY( cPort )
cCmd += " -P " + cPort
ENDIF
hLib = LOADLIBRARY( "sndmail.dll" )
SMTPLIBOPEN()
nRes = SMTPSENDMAIL( cCmd )
SMTPLIBCLOSE()
FREELIBRARY( hLib )
FERASE( cMsgFile )
RETURN nRes = 0
DLL STATIC FUNCTION SMTPLIBOPEN() AS VOID;
PASCAL FROM "USmtpLibOpen" LIB hLib
DLL STATIC FUNCTION SMTPSENDMAIL( cCmd AS STRING ) AS LONG;
PASCAL FROM "USmtpCmdLineSendMail" LIB hLib
DLL STATIC FUNCTION SMTPLIBCLOSE() AS VOID;
PASCAL FROM "USmtpLibClose" LIB hLib