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

  1. /*
  2. **  MAILER.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 SEND_TO         "receipient's email address"
  14. ////// EXAMPLE //////////////////////////////////////////
  15. // #define SMTP_HOST_NAME  "mail.myisp.net"
  16. // #define YOUR_EMAIL_ADDR "<me@myisp.com>"
  17. // #define SEND_TO         "<mike@marshallsoft.com>"
  18. /////////////////////////////////////////////////////////
  19.  
  20. static char Buffer[512];
  21.  
  22. void ErrorExit(int Code)
  23. {seeErrorText(Code,(LPSTR)Buffer,512);
  24.  printf("SEE Error %d: %s\n", Code, Buffer);
  25.  exit(1);
  26. }
  27.  
  28. void main(int argc, char *argv[])
  29. {int Code;  
  30.  /* connect to SMTP server */
  31.  puts("Calling seeConnectTo()...");
  32.  Code = seeConnectTo(
  33.     (LPSTR)SMTP_HOST_NAME,                          /* SMTP server */
  34.     (LPSTR)YOUR_EMAIL_ADDR,                         /* return email address */ 
  35.     (LPSTR)NULL);                                   /* Reply-To header */
  36.  if(Code<0) ErrorExit(Code); 
  37.  /* send email */
  38.  puts("Calling seeSendEmail()...");
  39.  Code = seeSendEmail(
  40.     (LPSTR)SEND_TO,                                 /* To list */
  41.     (LPSTR)NULL,                                    /* CC list */
  42.     (LPSTR)NULL,                                    /* BCC list */
  43.     (LPSTR)"MAILER Test",                           /* subject */
  44.     (LPSTR)"This is a test.\r\n\r\n--Mike",         /* message text */
  45.     (LPSTR)NULL);                                   /* MIME attachment */                
  46.  if(Code<0) ErrorExit(Code); 
  47.  puts("Calling seeClose()...");
  48.  Code = seeClose();
  49. } /* end main */
  50.  
  51.  
  52.