FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour any sample with sending mail
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Thu Jun 12, 2008 05:38 PM

anybody has sample with sending mail ?

best regards

kajot
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
any sample with sending mail
Posted: Thu Jun 12, 2008 06:16 PM

See FWH\samples\testmail.prg and testsmtp.prg.

testmail.prg uses MAPI and testsmtp uses SMTP.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Thu Jun 12, 2008 06:24 PM

I test testsmtp, but it does't send my mail.

best regards

kajot
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
any sample with sending mail
Posted: Thu Jun 12, 2008 06:36 PM

Did you edit it with your own SMTP server? You can't use the fivewin SMTP server. If you don't have an SMTP sever, then you can't use this program. Also, I think some SMTP servers require user authentication in which case this program won't work.

There is a third party TSMTP class that has more features. However lots of people have had trouble using both versions. A lot seems to depend on the SMTP server.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Thu Jun 12, 2008 07:39 PM

how may I check , if may SMTP server required authorization
my SMTP server: smtp.hot.pl

best regards

kajot
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Thu Jun 12, 2008 07:43 PM

what I have to setup if may smtp server required authorizatio

best regards

kajot
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
any sample with sending mail
Posted: Fri Jun 13, 2008 01:03 AM

Kajot,

You can google for blat.exe. This program is a command line program to send email via SMTP. You can try to send email via your server with this to see if it works. If you can get it working with blat.exe, then maybe you can get it working with FWH.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
any sample with sending mail
Posted: Fri Jun 13, 2008 03:40 PM
Friends

Take look this:

...
   DEFINE BUTTON OF oBar ;
                 ACTION Blat( "Este e o corpo da mensagem",;
                              "smtp.itelefonica.com.br",;
                              "jscrocha@terra.com.br",;
                              "irochinha@itelefonica.com.br",;
                              "Greetings from Joe!",;
                              "Usuario",;
                              "Senha",;
                              "c:\autoexec.bat" ) TOOLTIP "Enviar Mail"
...


The Blat code:
...
function blat( cbody ,;
               cserver ,;
               cMailTo ,;
               cMailFrom ,;
               csubject ,;
               cUserEmail ,;
               cUserPassWord ,;
               cattach )
     BlatCMD := [ blat.txt] + ;
                [ -server ]   + alltrim(cserver) + ;
                [ -to ]       + alltrim(cMailTo) + ;
                [ -f ]        + alltrim(cf) + ;
                [ -mailfrom ] + alltrim(cMailFrom) + ;
                [ -subject "] + alltrim(csubject) + ["] + ;
                [ -r ]        + ;
                [ -u ]        + alltrim(cUserEmail) + ;
                [ -pw ]       + alltrim(cUserPassWord) + ;
                [ -log "email.log" -debug ] + ;
                iif( empty( cAttach ),[],[ -attach "] + alltrim(cattach) + ["])
     cMacro="BLAT.EXE " + BlatCMD
     fErase( "email.log" )
     cBody := FormHtml( cSubject, cBody )
     memowrit( "blat.txt", cbody )
     //memowrit( "blat.bat", cMacro )
     WinExec( cMacro, 0 )
     if file( "email.log" )
        BlatLOG := memoread( "email.log" )
        if "ERROR" $ Upper(BlatLOG)
            Mensagem( "Erro: arquivo de EMAIL.LOG foi criado" )
            return .f.
        endif
     endif
     RETURN .T.
...


Authentication need your SMTP Server and POP user and password.
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Sat Jun 14, 2008 05:55 PM

what is variable cf ????
and function FormHtml( cSubject, cBody )

best regards

kajot
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
any sample with sending mail
Posted: Sun Jun 15, 2008 01:19 PM

>>what is variable cf ????

-cf <file> : cc receipts list filename

  • Ramesh Babu P
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Mon Jun 16, 2008 02:59 PM

cf ??
this is name file whitch I want to send ?

best regards

kajot
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
any sample with sending mail
Posted: Mon Jun 16, 2008 03:11 PM
function blat( cbody ,; 
               cserver ,; 
               cMailTo ,; 
               cf,;
               cMailFrom ,; 
               csubject ,; 
               cUserEmail ,; 
               cUserPassWord ,; 
               cattach ) 
     BlatCMD := [ blat.txt] + ; 
                [ -server ]   + alltrim(cserver) + ; 
                [ -to ]       + alltrim(cMailTo) + ; 
                [ -f ]        + alltrim(cf) + ; 
                [ -mailfrom ] + alltrim(cMailFrom) + ; 
                [ -subject "] + alltrim(csubject) + ["] + ; 
                [ -r ]        + ; 
                [ -u ]        + alltrim(cUserEmail) + ; 
                [ -pw ]       + alltrim(cUserPassWord) + ; 
                [ -log "email.log" -debug ] + ; 
                iif( empty( cAttach ),[],[ -attach "] + alltrim(cattach) + ["])


You have to include "cf" as fourth parameter in Blat Function (which is missing in the example) and supply the cc receipts list filename as cf.

- Ramesh Babu P
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
any sample with sending mail
Posted: Mon Jun 16, 2008 03:39 PM

Kajot,

>cf ??
>this is name file whitch I want to send ?

No this is the name of a text file containing a list of the addresses of recipients that you want the mail to be CC'd (carbon copied) to.

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
any sample with sending mail
Posted: Mon Jun 16, 2008 05:56 PM

do You have any sample ?

best regards

kajot
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
any sample with sending mail
Posted: Mon Jun 16, 2008 06:04 PM

Kajot,

>do You have any sample ?

It is just a list of email addresses.

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion