PHP mail problem Chapter 102

Discussion in 'PHP' started by Weirfire, Sep 26, 2006.

  1. #1
    It seems like I'm always having problems with the mail function.

    I'm trying to send emails to an array of email addresses which you can see with the extract of code below;


    $thelist [] = "email@email.com";
    $thelist [] = "email2@email.com";
    
    mail("' . $thelist[$i] . '",$subject,$message,$mailheaders);
    PHP:
    When I replace ' . $thelist[$i] . '

    with my email address it works.

    The $i is referenced from the for loop and the fact it send the email when I do the replacement means the problem has been identified in the syntax of the email address section. I've tried a few things but can't get it to work.

    If anyone has an idea you would save me a major headache! :)
     
    Weirfire, Sep 26, 2006 IP
  2. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #2
    :eek: I made a newby mistake of leaving out the _ on $the_list

    I thought I was going crazy! lol
     
    Weirfire, Sep 26, 2006 IP