2
SwiftMailer가 array()
으로 이메일 주소를 가져 오려고합니다. 원래 예제가 있는데 그 안에 넣고 싶은 것을 알고 있지만 나무에서 숲을 볼 수는 없습니다 ... 적절한 눈 거기에 하나라도하십시오PHP 배열 및 mysql 구문 오류
// Send the message
$result = $mailer->send($message);
// Send the message
$failedRecipients = array();
$numSent = 0;
내가 어려움을 겪고 있어요된다 :이 echo
가 작동
foreach($groups as $value)
{
echo "<h3>".$value."</h3>"; //this is working
// get the email groups
$sql="SELECT * FROM emails WHERE sendesstat=1 AND deleted=0 AND classhoz=\"".$value."\"";
$query=mysql_query($sql);
// fetch the emails from the group
while($data=mysql_fetch_array($query))
{
$emil="'".$data["email"]."' => '".$data["firstname"]." ".$data["surname"]."'";
echo $emil;
을하지만 난 $to[]
배열에 넣을 수 없습니다 ... (죄송합니다) 다음과 같이 표시됩니다.
$to = array('[email protected]', '[email protected]' => 'A name');
문제는 given name => 'A name'
입니다. 아프다. 구문을 찾을 수 없습니다.
$to[ ]= $emil;
}
}
foreach ($to as $address => $name)
{
if (is_int($address)) {
$message->setTo($name);
} else {
$message->setTo(array($address => $name));
}
$numSent += $mailer->send($message, $failedRecipients);
}
printf("Sent %d messages\n", $numSent);
제발 제발 다른 모든 것들은 현재 작동하고 있습니다.이 비트가 없습니다. 감사합니다
덕분에 아주 많이 나는 내 코드에 넣어 갈거야 :)))) 덕분에 많은 다시 –
@AndrasSebestyen, 내가 당신을 위해 일한 기뻐요. – Starx