You are here: mail() '-' problem « PHP Programming Language « IT news, forums, messages
mail() '-' problem

Posted by torbs on 10/25/61 11:32

Hi

I have I problem with a function that send out mail. It works with
every email-adresses except those containing "-". I have severeal
groups of emails, and it send mail to every group except one, who has a
mail adress with "-". In this group, no one recieve mail.

Tor



if (isset($_POST['send_post'])) {
$epostliste="";
$epostgruppe[]="";

$sql = "SELECT * FROM grupper";
$resultat = mysql_query($sql, $tilkobling);
while ($rad =mysql_fetch_array($resultat) ) {
if (isset($_POST[$rad['kode']])) {
$epostgruppe[]=$rad['kode'];
}
}



if (!empty($epostgruppe[1])) {
while (list($nokkel, $kode) = each($epostgruppe)) {
if ( !empty($kode)) {
$sql = "SELECT * FROM brukere WHERE tilgang LIKE '%".$kode."%'";
//echo $sql;
$resultat = mysql_query($sql, $tilkobling);
while ($rad =mysql_fetch_array($resultat) ) {
if (strstr($rad['email'],"@")) {
if (empty($epostliste)) {
$epostliste=$rad['email'];

} else {
if (!strstr($epostliste,$rad['email'])) {
$epostliste=$epostliste . "," . $rad['email'];
}
}
}
}
}
}
}


if (!empty($_POST['andre']) && strstr($_POST['andre'],"@")) {
$epostliste= $_POST['andre'] . "," . $epostliste;
}

$headers = "From: hilde.doksrod@ikos.uio.no\r\n";
$headers .= "MIME-Version: 1.0" . "\n";
$headers .= "Content-type: text/html; charset= ISO-8859-1 \n\n";

$emne=$_POST['emne'];

$beskjed="<html><body>".stripslashes($_POST['mailbody'])."</body></html>";


echo "Epost sendt...";


mail($epostliste, $emne, $beskjed, $headers);

}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация