Chris Corbyn wrote:What does this show?
Code: Select all
$it =& new Swift_Iterator_MySQLResult($rsMailing);
if ($it->hasNext())
{
echo "Moving to next row<br />";
$it->next();
echo "Current value is:";
var_dump($it->getValue());
}
else
{
echo "Empty result set<br />";
}
It shows as follows:
Moving to next row
Current value is:object(swift_address)(2) { ["address"]=> string(13) "
sano@sano.com" ["name"]=> string(4) "Stan" }
Also the output for print_r($recipients) is as follows:
swift_recipientlist Object ( [to] => Array ( ) [cc] => Array ( ) [bcc] => Array ( ) [iterators] => Array ( [to] => swift_iterator_mysqlresult Object ( [resultSet] => Resource id #71 [currentRow] => Array ( [0] =>
sano@sano.com [Email] =>
sano@sano.com [1] => Stan [eName] => Stan ) [pos] => 0 [numRows] => 3 ) [cc] => [bcc] => ) )
There is total of 3 emails in the recordset, still no emails sent. BTW, The email shown here(
sano@sano.com, is the second of the 3 emails.
Also, if I put only 1 email in the list, the output for your code is an empty object.
Still another followup, following is the error code I got when switching from batchmailer back to $swift->send($message,$recipients, $sender)
Fatal error: Call to a member function on a non-object in /homepages/45/d171048273/htdocs/lib/Swift.php on line 443
Here are the results for a mailing list of 10 emails:
Moving to next row
Current value is:object(swift_address)(2) { ["address"]=> string(13) "
sano@sano.com" ["name"]=> string(4) "Stan" }
And for print_r($recipients):
swift_recipientlist Object ( [to] => Array ( ) [cc] => Array ( ) [bcc] => Array ( ) [iterators] => Array ( [to] => swift_iterator_mysqlresult Object ( [resultSet] => Resource id #71 [currentRow] => Array ( [0] =>
sano@sano.com [Email] =>
sana@sano.com [1] => Stan [eName] => Stan ) [pos] => 0 [numRows] => 10 ) [cc] => [bcc] => ) )
Again the email is the 2nd email in the list, no other emails shown in the result.