any sample with sending mail

Post Reply
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

any sample with sending mail

Post by kajot »

anybody has sample with sending mail ?
best regards
kajot
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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

testmail.prg uses MAPI and testsmtp uses SMTP.

James
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Post by kajot »

I test testsmtp, but it does't send my mail.
best regards
kajot
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Post by kajot »

how may I check , if may SMTP server required authorization
my SMTP server: smtp.hot.pl
best regards
kajot
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Post by kajot »

what I have to setup if may smtp server required authorizatio
best regards
kajot
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Friends

Take look this:

Code: Select all

...
   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:

Code: Select all

...
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.
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Post by kajot »

what is variable cf ????
and function FormHtml( cSubject, cBody )
best regards
kajot
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

>>what is variable cf ????

-cf <file> : cc receipts list filename

- Ramesh Babu P
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Post by kajot »

cf ??
this is name file whitch I want to send ?
best regards
kajot
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Code: Select all

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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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.
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Post by kajot »

do You have any sample ?
best regards
kajot
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Kajot,

>do You have any sample ?

It is just a list of email addresses.
Post Reply