Re: Mass Mailings

Josh Hillman ( (no email) )
Wed, 22 Apr 1998 17:23:42 -0400

From: Greg Keys <greg@loclnet.com>
I need to be able to send e-mail to groups of people based on various
criteria in their emerald accounts (such as service type, pay periods, net
software, etc)
Has anyone out there come up with a way of querying the database and
generating mail to those who meet a given criteria?

Here's one that I use all the time. It selects all "active" email
addresses that are associated with account-types with "PPP" in the
AccountType name (Business PPP, PPP Account, etc.). I exclude one master
billing record that contains a little over 100 dial-up services (second to
the last line). Of course you can go in and add whatever other criteria
you want:

SELECT DISTINCT sa.Email
FROM SubAccounts sa, MasterAccounts ma
WHERE sa.CustomerID = ma.CustomerID
AND ma.Active = 1
AND sa.Active = 1
AND sa.Email != ''
AND sa.AccountType LIKE '%PPP%'
AND ma.customerid != 837 /* Exclude IDT users */
ORDER BY sa.Email

I then take the output, copy/paste it into Notepad, do a search for " " and
replace them with "" to get rid of all spaces after each email address.
I'm using Post.Office, so I've got an "everyone@talstar.com" account that I
have setup to forward to to whatever addresses I put in there. I
copy/paste the email addresses from notepad into the forwarding area for
"everyone@talstar.com" and then send my mail to "everyone@talstar.com".
Doing this prevents the recipients from seeing who the mail went to. A few
minutes after I send the mail, I go back into the mailbox settings and
change the main address to something else, so that "everyone@talstar.com"
no longer really exists. This prevents someone else from sending mail to
that address and spamming all of the selected users.

Josh Hillman
hillman@talstar.com