smtp error with send to variable
Posted: Wed Nov 30, 2005 9:14 am
Hi,
I have the following code which loops through email addresses and is supposed to send the email to each user....... it is erroring. The variable email addresses are displaying fine in my echo output statement;
I have never used variables for the to address. Here is the error;
Please help.
I have the following code which loops through email addresses and is supposed to send the email to each user....... it is erroring. The variable email addresses are displaying fine in my echo output statement;
Code: Select all
$emailquery = "SELECT email_address FROM users";
$emailresult = mysql_query($emailquery) or die ("Query failed");
$numofrows = mysql_num_rows($emailresult);
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($emailresult);
echo $row['email_address'];
mail ("$row", "*** update ***",
"The news has been updated
Please log in a unread messages
This is an automated system message, please do no reply.");
}I have never used variables for the to address. Here is the error;
Code: Select all
Warning: mail(): SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in C:\Audit\add_news2.php on line 392
Warning: mail(): SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in C:\Audit\add_news2.php on line 392
Warning: mail(): SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in C:\Audit\add_news2.php on line 392