View Single Post
12-07-2011, 11:01 AM
#1
pinzdesign.com is offline pinzdesign.com
Status: I'm new around here
Join date: Feb 2011
Location: Copenhagen/DK
Expertise: php
Software: Paint
 
Posts: 15
iTrader: 0 / 0%
 

pinzdesign.com is on a distinguished road

  Old  Zend mail - help needed

I got a problem with Zend mail - addTo doesn't want to add addresses from an array, thou it does send with a single recipient from another script. It says 'bad syntaxys of recipient'.

Here is code part:

PHP Code:
        // Setting recipient
        
$q mysql_query("SELECT * FROM emailscategoriesmap WHERE fk_categoriesId='".$row['fk_categoriesId']."'");
        while(
$r mysql_fetch_assoc($q))
        {
            
$qu mysql_query("SELECT * FROM emails WHERE emailsId='".$r['fk_emailsId']."' AND emails_status='aktiv'");
            
$res $qu;
            
$e mysql_fetch_assoc($res);
            
$email mysql_real_escape_string($e['address']);
            
$mail->addTo($email$email);
            echo 
"$email<br />
            <pre>"
;
            
print_r($e);
            echo 
"</pre>";
        }
        
$mail->addTo('mail@hotmail.com''mymail');
        
// Setting mail subject
        
$mail->setSubject($row['name']);
        
// Sending mail
        
$setLoggetQuery mysql_query("UPDATE newsletter SET logget='1' WHERE newsletterId='".$row['newsletterId']."'");
        if(!
$setLoggetQuery) { echo "<span>Fejl!Nyhedsbrev blev ikke sendt.</span>"; }
        else {
            
$mail->send($transport);
            echo 
'Mail was sent successfully.';
        }
    } 
and i know for sure that the print_r i call for final query, shows the proper addresses, it just fails to add them one by one with addTo

pls help needed