Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005

    Unanswered: 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.


  2. #2
    Join Date
    Sep 2003
    Sounds like a PHP question.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts