![]() |
sponsored links |
|
|
sponsored links
|
|
1
2nd June 08:34
External User
Posts: 1
|
I have a mailing problem.
Firstly I have created a query of the people I want to mail. $result = @mysql_query ("SELECT email, newsid FROM news WHERE newsid=???"); if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $to = $row['email']; mail($to,"Title.\n","Body Text\n","From: test@test.co.uk\n"); } } However it does not seem to recognise the email address stored in $to. If I manually define the variable $to="test@test.co.uk" this works. The row information for $email is OK when I check with echo$email. What have I done wrong :-( Many thanks Alec |
|
|
|
2
2nd June 08:34
External User
Posts: 1
|
I have a mailing problem.
Firstly I have created a query of the people I want to mail. $result = @mysql_query ("SELECT email, newsid FROM news WHERE newsid=???"); if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $to = $row['email']; mail($to,"Title.\n","Body Text\n","From: test@test.co.uk\n"); } } However it does not seem to recognise the email address stored in $to. If I manually define the variable $to="test@test.co.uk" this works. The row information for $email is OK when I check with echo$email. What have I done wrong :-( Many thanks Alec |
|
|