home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / News / Alexandra.0.82 / Source / AMGErrorHandling.subproj / ErrorMail.m < prev    next >
Encoding:
Text File  |  1996-01-31  |  800 b   |  39 lines

  1.  
  2. #import <misckit/misckit.h>
  3. #import "EMErrorManager.h"
  4. #import "ErrorMail.h"
  5.  
  6. @implementation EMErrorAction(MiscMail)
  7.  
  8. - sendMailTo:(const char *)recipient subject:(const char *)subject 
  9.         body:(const char *)body;
  10.     {
  11.     MiscMailApp    *mail;
  12.     MiscString    *r,*s,*b;
  13.     MiscTime    *now;
  14.  
  15.     EM_DURING
  16.         now=[[MiscTime allocFromZone:[self zone]] initWithCurrentTime];
  17.         if([now year]==1996 && [now month]<4)
  18.             {
  19.             mail=[MiscMailApp localMailer];
  20.             EM_CONDERROR(mail==nil,EM_INTBASE+23,recipient,NULL);
  21.             r=[MiscString newWithString:recipient],
  22.             s=[MiscString newWithString:subject],
  23.             b=[MiscString newWithString:body];
  24.             [mail sendMailTo:r subject:s body:b];
  25.             [r free];
  26.             [s free];
  27.             [b free];
  28.             }
  29.     EM_HANDLER
  30.         [now free];
  31.         NX_RERAISE();
  32.     EM_ENDHANDLER
  33.     
  34.     now=[now free];
  35.     return self;    
  36.     }        
  37.  
  38. @end
  39.