Ninjakreborn Posted August 14, 2006 Share Posted August 14, 2006 [code] <?phpwhile ($row = mysql_fetch_array($emailquery)) { $to = "{$row[email]}"; $subject = "Funny Email Forwards Database Results"; $message = "You can see the results at this page: "; $message .= "http://www.funnyemailforwards.com/apex/limitedemailresults.php"; echo "<br />"; echo "{$row[email]}"; echo "<br />"; //mail($to, $subject, $message); }?>[/code]That is the script I am using to debug, it prints out all the emails, but when I cut it down and use my original script[code]<?phpwhile ($row = mysql_fetch_array($emailquery)) { $to = "{$row[email]}"; $subject = "Funny Email Forwards Database Results"; $message = "You can see the results at this page: "; $message .= "http://www.funnyemailforwards.com/apex/limitedemailresults.php"; mail($to, $subject, $message);?> [/code]It's not seeming to email them, I know this, because my email is in the database too, but it's not sending me an eamil, so I am guessing the others aren't either, adn I can't keep testing them and sending them emails over and over again, is there anythign wrong with this. Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/ Share on other sites More sharing options...
Buddyb3ar Posted August 14, 2006 Share Posted August 14, 2006 I'm not sure it'd be something, but the . before the = in[code] $message .= "http://www.funnyemailforwards.com/apex/limitedemailresults.php";[/code] Could cause a problem. You could also do something like[code]<?php while ($row = mysql_fetch_array($emailquery)) { $to = "{$row[email]}"; $subject = "Funny Email Forwards Database Results";$message = array(); $message[] = "You can see the results at this page: "; $message[] = "http://www.funnyemailforwards.com/apex/limitedemailresults.php"; mail($to, $subject, $message);?>[/code] Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74790 Share on other sites More sharing options...
Ninjakreborn Posted August 14, 2006 Author Share Posted August 14, 2006 It shouldn't be the . should it, I always did message like that, but I also never send an email through a query like that either, I will play with that, thanks. Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74791 Share on other sites More sharing options...
trq Posted August 14, 2006 Share Posted August 14, 2006 You might try...[code=php:0]$to = $row['email'];[/code] Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74809 Share on other sites More sharing options...
hitman6003 Posted August 15, 2006 Share Posted August 15, 2006 The .= operator appends the string afterward to the string variable...i.e. :[code]$message .= "http://www.funnyemailforwards...."[/code]Will append the http://....... to whatever $message previously was.That is not your problem.Thorpe probably has it right. Why are you assigning a value to $to using curly braces inside of double quotes? Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74834 Share on other sites More sharing options...
trq Posted August 15, 2006 Share Posted August 15, 2006 [quote]Why are you assigning a value to $to using curly braces inside of double quotes?[/quote]It would be perfectly valid (if still a little unnesessary) if he'd used quotes around the array key like your meant to when refering to non numerical keys. eg;[code=php:0]$to = "{$row['email']}";[/code] Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74838 Share on other sites More sharing options...
hitman6003 Posted August 15, 2006 Share Posted August 15, 2006 Had to look that up...not because I don't believe you, cause I wanted to see how it's done...never used it that way...I've always done it the way you suggested. Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74841 Share on other sites More sharing options...
trq Posted August 15, 2006 Share Posted August 15, 2006 Its only really usefull when using array values within a string. ie;[code=php:0]$arr = array('name' => 'foo');echo "Hello {$arr['name']}, how you doing?";[/code]As apposed to...[code=php:0]$arr = array('name' => 'foo');echo "Hello ". $arr['name']. ", how you doing?";[/code]Of course php is pretty forgiving with regard to quotes around array keys anyway, but that, IMO is a design floor. Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74848 Share on other sites More sharing options...
Ninjakreborn Posted August 15, 2006 Author Share Posted August 15, 2006 Thats the thing, I reallized my client was getting the proper email, he is on the list, of subscribers, plus he got his admin email at his other address, so I am assuming it is emailing some and missing some, quite confusing. Link to comment https://forums.phpfreaks.com/topic/17556-quick-query-question-sending-emails-through-row/#findComment-74898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.