i try to send multiple emails of a selected database to all recipients
i am inspired in this link, viewtopic.php?f=4&t=33248&p=94120&hilit=recipient#p94120
my code is:
// Email Sending event
function Email_Sending(&$Email, &$Args) {
$sSql = "SELECT `correoelectronico` FROM `propiedades`";
if ($rs = ew_Execute($sSql)) {
$rs->MoveFirst();
$emails = "";
while (!$rs->EOF) {
$emails .= $rs->fields("correoelectronico")."<br>"; // get the value of "email" field
$rs->MoveNext();
}
echo $emails; // display it to the screen
$rs->Close();
} else {
$this->setFailureMessage("No hay correos disponibles.");
}
$Email->Recipient = $emails;
$Email->Sender = $recipientsemail = CurrentUserInfo("correoelectronico");
$Email->Subject = "Nuevo elemento añadido en Tablon de Anuncios";
$Email->ReplaceContent("<!--titulo-->", "\n". "Titulo del Anuncio:" . " " . $Args['rsnew']['descripcion']);
$Email->ReplaceContent("<!--autor-->", "\n\r". "Nombre del autor: " . " " . $nombre = CurrentUserInfo("nombre"));
return TRUE;
}
but I get the following error: You must provide at least one recipient email address.
I'm doing something wrong?