any sample with sending mail

any sample with sending mail

Postby kajot » Thu Jun 12, 2008 5:38 pm

anybody has sample with sending mail ?
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby James Bott » Thu Jun 12, 2008 6:16 pm

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

testmail.prg uses MAPI and testsmtp uses SMTP.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby kajot » Thu Jun 12, 2008 6:24 pm

I test testsmtp, but it does't send my mail.
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby James Bott » Thu Jun 12, 2008 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby kajot » Thu Jun 12, 2008 7:39 pm

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

Postby kajot » Thu Jun 12, 2008 7:43 pm

what I have to setup if may smtp server required authorizatio
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby James Bott » Fri Jun 13, 2008 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Rochinha » Fri Jun 13, 2008 3:40 pm

Friends

Take look this:

Code: Select all  Expand view
...
   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  Expand view
...
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.
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby kajot » Sat Jun 14, 2008 5:55 pm

what is variable cf ????
and function FormHtml( cSubject, cBody )
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby RAMESHBABU » Sun Jun 15, 2008 1:19 pm

>>what is variable cf ????

-cf <file> : cc receipts list filename

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby kajot » Mon Jun 16, 2008 2:59 pm

cf ??
this is name file whitch I want to send ?
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby RAMESHBABU » Mon Jun 16, 2008 3:11 pm

Code: Select all  Expand view
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
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby James Bott » Mon Jun 16, 2008 3: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.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby kajot » Mon Jun 16, 2008 5:56 pm

do You have any sample ?
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby James Bott » Mon Jun 16, 2008 6:04 pm

Kajot,

>do You have any sample ?

It is just a list of email addresses.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 55 guests