Jump to content

Track Emails Sent


aeboi80

Recommended Posts

Short Question: 

 

Essentially what I need to do is be able to track the number of email messages a member in the database sends out.

 

Long Question:

 

I have an affiliate script which I want to enable the members to send out emails, but I want to limit them to only X number per day, say 1,000 emails per day.  I am NOT using php mail but rather smtp.  Is there someway which I can track how many messages they are sending?  I can't think of any system to actually make this work.  I first thought of institutiing a credit system...say 1,000 credits for the day would give you the ability to send out 1,000 emails, but the problem I am running into is not knowing how PHP/SMTP records the number going out.

 

Any thoughts?

 

Chad

Link to comment
https://forums.phpfreaks.com/topic/180354-track-emails-sent/
Share on other sites

In the user table, have a column that has 1000. Everytime a person sends an email, deduct one from that number:

 

mysql_query("UPDATE user SET num_emails = num_emails - 1 WHERE user_id = $user_id") or trigger_error(mysql_error());

 

Then run a script once every 24 hours using a cron job that replenishes each users number back to 1000.

Link to comment
https://forums.phpfreaks.com/topic/180354-track-emails-sent/#findComment-951414
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.