Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Mailing Problem
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 2nd June 08:34
alec
External User
 
Posts: 1
Default Mailing Problem



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
  Reply With Quote


  sponsored links


2 2nd June 08:34
alec
External User
 
Posts: 1
Default Mailing Problem



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
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666