SEND EMAIL

Re: SEND EMAIL

Postby James Bott » Thu Apr 04, 2013 1:44 pm

Enrico,

>I don't like it very much because I still don't know what the error is so I can't trap it.

You don't need to know what it is, just loop back from where the msgInfo() displaying the error message (the one after the send).

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

Re: SEND EMAIL

Postby James Bott » Thu Apr 04, 2013 2:10 pm

Enrico,

Here is a sample using a loop on error (not tested).

James

Code: Select all  Expand view

   local lError :=.f.
   local nCounter:=0
   local nTrys:=3
   local nWait:= 5 // in seconds
   
   ...
   
   do while lError .and. nCounter < nTrys
       TRY
          oEmailMsg := CREATEOBJECT ( "CDO.Message" )
          WITH OBJECT oEmailMsg
            ...
            :Send()
          END WITH
          SysRefresh()
       CATCH oError
          lError:=.t.
          nCounter++
          waitSeconds( nWait )
       END
   enddo

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

Re: SEND EMAIL

Postby Enrico Maria Giordano » Thu Apr 04, 2013 5:01 pm

James Bott wrote:Enrico,

>I don't like it very much because I still don't know what the error is so I can't trap it.

You don't need to know what it is, just loop back from where the msgInfo() displaying the error message (the one after the send).

James


Still I don't like it very much. :-) I prefer to know what I deal with... :-)

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

Re: SEND EMAIL

Postby Enrico Maria Giordano » Thu Apr 04, 2013 5:02 pm

James Bott wrote:Enrico,

Here is a sample using a loop on error (not tested).


Thank you.

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

Re: SEND EMAIL

Postby James Bott » Thu Apr 04, 2013 5:14 pm

Enrico,

I just realized that you are probably going to need to set oError to nil in the CATCH oError routine--even if just for clarity.

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

Re: SEND EMAIL

Postby Enrico Maria Giordano » Thu Apr 04, 2013 5:16 pm

Ok, thank you. I'm still waiting the client report after your SysRefresh() suggestion... :-)

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

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