If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Email Address from my DB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-19-05, 12:57
defcon2000 defcon2000 is offline
Registered User
 
Join Date: Dec 2005
Posts: 5
Email Address from my DB

Hello Everyone,

I need help with the following php script.

I have the following statement:

$tmpemailreminder = mysql_query("
SELECT reminder , reminded, emailtoperson1, emailtoperson2, emailtoperson3,
email_address, emailme
FROM reminder, users
WHERE reminder.username = users.username
AND reminder.reminderdate = SUBDATE(CURDATE(), INTERVAL 1 DAY)
AND reminder.status = 'Open'
AND reminder.reminded = 'N
'", $conn) or die('Query failed: ' . mysql_error());

The fields emailtoperson1, emailtoperson2, emailtoperson3 and email_address are populated with email address.

The idea is to run a loop and
if emailme = 'Y' then send email to email_address, with subject "Reminder" and body "reminder"

if emailtoperson1 IS NOT NULL then send email to emailtoperson1, with subject "Reminder" and body "reminder"

if emailtoperson2 IS NOT NULL then send email to emailtoperson2, with subject "Reminder" and body "reminder"

if emailtoperson3 IS NOT NULL then send email to emailtoperson3, with subject "Reminder" and body "reminder"

Can someone help me with this. I noticed that PEAR::Mail is on our server and would like to use this.

Thanks for your help in advance.

Rgds,
Reply With Quote
  #2 (permalink)  
Old 12-21-05, 22:10
localhost localhost is offline
Registered User
 
Join Date: Sep 2003
Posts: 13
Sounds like a PHP question.

Get the email addresses, do what you want with them, then use mail()

http://php.net/mail
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On