Page 1 of 1

Sending emails based on mysql data

Posted: Tue Mar 17, 2009 12:28 am
by vinodc
Hi

Im new to this forum. Also im not a php programmer actually.

I have my CentOS Linux based VoIP server running with PHP 5.1.6, mysql 5.0.45, Apache 2.2.3.

My mysql database table contains data like Username, Password, Balance, Address, Email addess, Phone, etc. The requirement is, i need to send email to the users whose "Balance" is <= somecredit.

Whether this logic is possible using a single php script, and if yes, can this script check the data for all the users and process sequentially?

Please advice me some help with the script...... :banghead:

Thanks in advance
Vino

Re: Sending emails based on mysql data

Posted: Tue Mar 17, 2009 12:46 am
by Chris Corbyn
So you just need to write a SQL query basically that selects all users whose credit <= some amount.

Then using Swift Mailer is no different to any other program... you just use the email addresses returned from the database instead of hard-coding them in the script.

It's certainly possible :)