FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SEND EMAIL
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SEND EMAIL
Posted: Thu Apr 04, 2013 01: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SEND EMAIL
Posted: Thu Apr 04, 2013 02:10 PM
Enrico,

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

James

Code (fw): Select all Collapse
   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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: SEND EMAIL
Posted: Thu Apr 04, 2013 05: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: SEND EMAIL
Posted: Thu Apr 04, 2013 05:02 PM
James Bott wrote:Enrico,

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


Thank you.

EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SEND EMAIL
Posted: Thu Apr 04, 2013 05: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: SEND EMAIL
Posted: Thu Apr 04, 2013 05:16 PM

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

EMG

Continue the discussion