A tool to send email ?

Re: A tool to send email ?

Postby albeiroval » Mon Jun 13, 2016 2:46 pm

Enrico,

Please you can set an example for sendmail (...), for the case of using cServer ?
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 372
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: A tool to send email ?

Postby Enrico Maria Giordano » Mon Jun 13, 2016 3:01 pm

Sorry, I haven't understood your question...

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: A tool to send email ?

Postby karinha » Mon Jun 13, 2016 3:19 pm

Perfect! Thanks.

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: A tool to send email ?

Postby karinha » Mon Jun 13, 2016 3:23 pm

link for download sndmail.dll

http://www.xmailserver.org/SndMail-2.5.zip

Code: Select all  Expand view

#include "Fivewin.ch"

STATIC hDll

FUNCTION MAIN()

   LOCAL cFrom     := "joao@pleno.com.br"
   LOCAL cServer   := "smtp.pleno.com.br"
   LOCAL cTo       := "joao@pleno.com.br"
   LOCAL cSubjeCt  := "Test with sendmail.dll"
   LOCAL cMessage  := "Test with sendmail.dll - Email Body"
   LOCAL cSender   := "joao@pleno.com.br"
   LOCAL cUser     := "joao@pleno.com.br"
   LOCAL cPassword := "xxxx999"
   LOCAL aAttach := {}
   LOCAL aCc     := ""  //???
   LOCAL lHtml   := .F.
   LOCAL cPort := "587"
   LOCAL lNotification := .F. // cFrom
   LOCAL lRet

   lRet := SENDMAIL( cFrom, cServer, cTo, cSubject, cMessage, cSender, cUser, cPassword, aAttach, aCc, lHtml, cPort, lNotification )

   IF lRet

      ? "Message sent successfully"

   ELSE

      ? "Unsent message check windows live mail"

   ENDIF

RETURN NIL

FUNCTION SENDMAIL( cFrom, cServer, cTo, cSubject, cMessage, cSender, cUser, cPassword, aAttach, aCc, lHtml, cPort, lNotification )


    LOCAL cMsgFile := CTEMPFILE()

    LOCAL cCmd := "SndMail -f " + cFrom + " -X " + cServer + " -r " + cTo + " -s " + ["] + cSubject + ["] + " -b " + cMsgFile

    LOCAL nRes

    LOCAL i

    DEFAULT lHtml := "<html" $ LOWER( cMessage )

    MEMOWRIT( cMsgFile, cMessage + CRLF )

    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

    IF !EMPTY( lNotification )
       cCmd += " -t " + ["] + "Disposition-Notification-To: " + cFrom + ["]
    ENDIF

    hDLL = LOADLIBRARY( "sndmail.dll" )

    IF hDll = 0
       ? [Install sendmail.dll.. ]
       __QUIT()
    ELSE
       SMTPLIBOPEN() // OPEN sndmail.dll
    ENDIF

    nRes = SMTPSENDMAIL( cCmd )

    SMTPLIBCLOSE()

    FREELIBRARY( hDLL )

    FERASE( cMsgFile )

RETURN nRes = 0

DLL STATIC FUNCTION SMTPLIBOPEN() AS VOID;
    PASCAL FROM "USmtpLibOpen" LIB hDll

DLL STATIC FUNCTION SMTPSENDMAIL( cCmd AS STRING ) AS LONG;
    PASCAL FROM "USmtpCmdLineSendMail" LIB hDll

DLL STATIC FUNCTION SMTPLIBCLOSE() AS VOID;
    PASCAL FROM "USmtpLibClose" LIB hDll

// END OF PROGRAM
 


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: A tool to send email ?

Postby karinha » Mon Jun 13, 2016 3:44 pm

Last edited by karinha on Wed Jun 15, 2016 1:07 pm, edited 1 time in total.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: A tool to send email ?

Postby albeiroval » Mon Jun 13, 2016 7:13 pm

Enrico,

puedes mostrar un ejemplo de uso de sendmail() con el parametro cServer ?

Google translator :

you can show an example of using sendmail () with the parameter cServer?
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 372
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: A tool to send email ?

Postby Enrico Maria Giordano » Mon Jun 13, 2016 8:43 pm

The parameter cServer is the smtp server used to send the email.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: A tool to send email ?

Postby vilian » Mon Sep 19, 2016 2:47 pm

Is it working to send with TLS/e-mails?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: A tool to send email ?

Postby MarcoBoschi » Fri Sep 23, 2016 3:52 pm

> Is it working to send with TLS/e-mails?
In my opinion the answer is NO
Bye
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: A tool to send email ?

Postby vilian » Fri Sep 23, 2016 5:10 pm

Is there some way to do this ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 50 guests