Closed Thread
Results 1 to 5 of 5

Thread: php email problem !!

  1. #1
    Flezria is offline Learning Programmer
    Join Date
    Sep 2009
    Posts
    55
    Rep Power
    0

    Angry php email problem !!

    Hey guyse.
    I got this php email problem.

    I need to Select an email from a database and send a mail to them.

    Like this:

    Code:
    $email $_POST['email'];

    $to_email mysql_query("SELECT email FROM emails WHERE email = '$email'");
    $email mysql_fetch_array($to_emailMYSQL_BOTH);

    $to = ;
    $subject 'mail example';
    $message 'example from example with example..';
    $headers Fromexample@example.com

    mail
    ($to$subject$message$headers); 
    but here comes the problem.
    How do i get the email out of the database so i can use it in $to variable.
    i need it as the email, as a string, so i will send it correctly.

    Thanks !! from flezria

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    brokenbylaw's Avatar
    brokenbylaw is offline Learning Programmer
    Join Date
    Dec 2009
    Posts
    62
    Rep Power
    0

    Re: php email problem !!

    what does the DB look like?

  4. #3
    Flezria is offline Learning Programmer
    Join Date
    Sep 2009
    Posts
    55
    Rep Power
    0

    Re: php email problem !!

    Its a mysql database?

  5. #4
    Jaan Guest

    Re: php email problem !!

    Code:
    $email $_POST['email'];

    $sql "SELECT email FROM emails WHERE email='".$email."'";
    $to_email mysql_query($sql);
    $email mysql_fetch_array($to_email);

    $to $email['email'];
    $subject 'mail example';
    $message 'example from example with example..';
    $headers Fromexample@example.com

    mail
    ($to$subject$message$headers); 
    Umm.. it should work..

  6. #5
    Flezria is offline Learning Programmer
    Join Date
    Sep 2009
    Posts
    55
    Rep Power
    0

    Re: php email problem !!

    I got it working.
    Just replaced the fetch_array with fetch_row

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Email Problem with PHP
    By graphic360 in forum PHP Development
    Replies: 3
    Last Post: 08-21-2011, 01:36 PM
  2. Java problem -- sending email via JSP page
    By mrclubbie in forum Java Help
    Replies: 2
    Last Post: 08-12-2010, 11:08 AM
  3. Problem sending forms to email
    By k4m1k4z1 in forum HTML Programming
    Replies: 6
    Last Post: 06-14-2010, 11:00 PM
  4. Reading email from external email account
    By amrosama in forum PHP Development
    Replies: 5
    Last Post: 01-25-2010, 07:23 PM
  5. Inbound eMail problem with WHM
    By Wanch in forum Linux Installation & Configuration
    Replies: 2
    Last Post: 06-22-2008, 07:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

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