home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LC / SEE4C10.ZIP / MULTI.C < prev    next >
C/C++ Source or Header  |  1998-05-31  |  3KB  |  70 lines

  1. /*
  2. **  MULTI.C
  3. */
  4.  
  5. #include <windows.h>
  6. #include <stdio.h>
  7. #include "see.h"
  8.  
  9. /////////////////////////////////////////////////////////
  10. ////// IMPORTANT: edit these definitions before compiling 
  11. #define SMTP_HOST_NAME  "smtp_host_name"
  12. #define YOUR_EMAIL_ADDR "your_email_address"
  13. #define FIRST_SEND_TO   "1st receipient's email address"
  14. #define SECOND_SEND_TO  "2nd receipient's email address"
  15. ////// EXAMPLE //////////////////////////////////////////
  16. // #define SMTP_HOST_NAME  "mail.myisp.net"
  17. // #define YOUR_EMAIL_ADDR "<me@myisp.com>"
  18. // #define FIRST_SEND_TO   "<mike@marshallsoft.com>"
  19. // #define SECOND_SEND_TO  "<pam@marshallsoft.com>"
  20. /////////////////////////////////////////////////////////
  21.  
  22. static char Buffer[512];
  23.  
  24. void ErrorExit(int Code)
  25. {seeErrorText(Code,(LPSTR)Buffer,512);
  26.  printf("%s\n", Buffer);
  27.  exit(0);
  28. }
  29.  
  30. /*** main ***/
  31.  
  32. void main(int argc, char *argv[])
  33. {int Code; 
  34.  /* define diagnostics log file */
  35.  seeStringParam(SEE_LOG_FILE, (LPSTR)"multi.log");  
  36.  puts("Calling seeConnectTo()...");
  37.  Code = seeConnectTo(
  38.     (LPSTR)SMTP_HOST_NAME,                     /* SMTP server */
  39.     (LPSTR)YOUR_EMAIL_ADDR,                    /* our return email address */
  40.     (LPSTR)NULL);                              /* Reply-To header */
  41.  if(Code<0) ErrorExit(Code);
  42.   
  43.  /* send first email [Please edit addresses below] */
  44.  puts("Calling seeSendEmail() #1 ...");
  45.  Code = seeSendEmail(
  46.     (LPSTR)FIRST_SEND_TO,                      /* To list */
  47.     (LPSTR)NULL,                               /* CC list */
  48.     (LPSTR)NULL,                               /* BCC list */
  49.     (LPSTR)"MULTI Example Program",            /* subject */
  50.     (LPSTR)"Hello from MULTI.C !!!\r\nBye!",   /* text message */
  51.     (LPSTR)NULL);                              /* no attachment */                
  52.  if(Code<0) ErrorExit(Code); 
  53.  
  54.  /* send second email */  
  55.  puts("Calling seeSendEmail() #2 ...");
  56.  Code = seeSendEmail(
  57.     (LPSTR)SECOND_SEND_TO,                     /* To list */
  58.     (LPSTR)NULL,                               /* CC list */
  59.     (LPSTR)NULL,                               /* BCC list */    
  60.     (LPSTR)"MULTI Example Program",            /* subject */
  61.     (LPSTR)"@test.mai",                        /* message in file */
  62.     (LPSTR)"test.zip");                        /* attachment (size will be multiple of 4) */                
  63.  if(Code<0) ErrorExit(Code);
  64.  puts("Calling seeClose()...");
  65.  Code = seeClose();
  66.  if(Code<0) ErrorExit(Code);
  67. } /* end main */
  68.  
  69.  
  70.