PHP Classes

php mail script sent to several companies

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  php mail script sent to several...  
Subject:php mail script sent to several...
Summary:automated script that sends mails to several companies
Messages:2
Author:chenci
Date:2012-03-01 17:51:11
Update:2012-03-11 05:00:32
 

  1. php mail script sent to several...   Reply   Report abuse  
Picture of chenci chenci - 2012-03-01 20:22:08
i'm working on a automated script to send mails at 10am (using cron job) to a series of companies' mails stored in my database. I have the main idea, but i don't know to start. Basically i'm stuck in those last items since i'm still learning. These are the 3 tables i have

Table company: id, company_name company_mail
Table log: id, company_id, plate_id, buy_date, ticket_id
Table menu: id, plate_name, plate_price, company_id

This is what i want to do:
1) I have to select all the row from 14pm of the day before to 10am of today with this code
SELECT * from log WHERE buydate BETWEEN date_add(date_sub(curdate(), interval 1 day), interval 14 hour) and date_add(curdate(), interval 10 hour)

2) Select all the companies ids, find repeated ones and group them together.

3) Populate a table with the information based on the company id and their plates
ie: Company_id 1: 3rows (containing plate_id 1,2,3). Company_id 2: 1row (containing plate_id 4)

4) Cross reference plate_id in plate table to show plate_name, plate_price in the table above (instead of plate_ids), send mail to each company with their corresponding information. Thanks

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.