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 >
Wrap
Text File
|
2000-05-26
|
2KB
|
77 lines
##########################################################
# GDIdb demo script (c) 1998 Global Data Industries
#
# This script sends a non-personalised e-mail to everyone
# in the database. The advantage of sending a
# non-personalised e-mail is that if the list is large,
# the e-mail will still send quickly since GDIdb will only
# need to send the e-mail text to the server once.
##########################################################
##########################################################
# define variables used in script
&defvar(?listaddr?)
##########################################################
# this database contains the list of e-mail addresses
# and contact information
&datasource("Driver={Microsoft Access Driver (*.mdb)};DBQ=examples.mdb")
##########################################################
# create a comma-separated text string containing all of
# the e-mail addresses in the database
&getdata("SELECT * FROM tblEmployees")
{
&assign(?listaddr?,"?listaddr??email?")
&if(?rownumber?!=?recordsetsize?)
{
&assign(?listaddr?,"?listaddr?,")
}
}
##########################################################
# Alter the following line to &dialup(TRUE) if you want
# GDIdb to dial your Internet connection before sending
# e-mails.
&dialup(FALSE)
{
# send the following e-mail to all the e-mail addresses contained in ?listaddr?
&sendmail( "mail.mydomain.com" , "me@mydomain.com" , "?listaddr?")
{
HEADER:
From: "Fred" <fred@mydomain.com>
To: Valued.Employee@mydomain.com
Subject: Christmas Party
Date: ?gdidbdate.dn?, ?gdidbdate.d? ?gdidbdate.mn? ?gdidbdate.y? ?gdidbtime?
BODY:
Dear Employee,
We are writing to inform you of this year's Christmas party. Because you
have worked so hard this year, the company wishes to take you to Hawaii
for a week-long surfing holiday. Boards and wax shall naturally be provided
complements of the company.
Hang five,
--
Fred Bloggs MD
}
}