home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / sharewar / gdidbpro / data1.cab / Example_Files / projects / default / mailshot2.scp < prev    next >
Text File  |  2000-05-26  |  2KB  |  77 lines

  1. ##########################################################
  2. # GDIdb demo script (c) 1998 Global Data Industries
  3. #
  4. # This script sends a non-personalised e-mail to everyone
  5. # in the database. The advantage of sending a
  6. # non-personalised e-mail is that if the list is large,
  7. # the e-mail will still send quickly since GDIdb will only
  8. # need to send the e-mail text to the server once.
  9. ##########################################################
  10.  
  11.  
  12.  
  13.  
  14. ##########################################################
  15. # define variables used in script
  16.  
  17. &defvar(?listaddr?)
  18.  
  19.  
  20.  
  21.  
  22. ##########################################################
  23. # this database contains the list of e-mail addresses
  24. # and contact information
  25.  
  26. &datasource("Driver={Microsoft Access Driver (*.mdb)};DBQ=examples.mdb")
  27.  
  28.  
  29.  
  30.  
  31. ##########################################################
  32. # create a comma-separated text string containing all of
  33. # the e-mail addresses in the database
  34.  
  35. &getdata("SELECT * FROM tblEmployees")
  36. {
  37.     &assign(?listaddr?,"?listaddr??email?")
  38.     &if(?rownumber?!=?recordsetsize?)
  39.     {
  40.         &assign(?listaddr?,"?listaddr?,")
  41.     }
  42. }
  43.  
  44.  
  45.  
  46.  
  47. ##########################################################
  48. # Alter the following line to &dialup(TRUE) if you want
  49. # GDIdb to dial your Internet connection before sending
  50. # e-mails.
  51.  
  52. &dialup(FALSE)
  53. {
  54.     
  55.     # send the following e-mail to all the e-mail addresses contained in ?listaddr?
  56.     &sendmail( "mail.mydomain.com" , "me@mydomain.com" , "?listaddr?")
  57.     {
  58.         HEADER:
  59.         From: "Fred" <fred@mydomain.com>
  60.         To: Valued.Employee@mydomain.com
  61.         Subject: Christmas Party
  62.         Date: ?gdidbdate.dn?, ?gdidbdate.d?    ?gdidbdate.mn? ?gdidbdate.y? ?gdidbtime?
  63.     
  64.         BODY:
  65.         Dear Employee,
  66.         We are writing to inform you of this year's Christmas party. Because you
  67.         have worked so hard this year, the company wishes to take you to Hawaii
  68.         for a week-long surfing holiday. Boards and wax shall naturally be provided
  69.         complements of the company.
  70.         
  71.         Hang five,
  72.         --
  73.         Fred Bloggs MD
  74.     }
  75. }
  76.  
  77.