function sendHTMLemail($HTML,$from,$to,$subject)
{
// First we have to build our email headers
// Set out "from" address
$headers = "From: $from\r\n";
// Now we specify our MIME version
$headers .= "MIME-Version: 1.0\r\n";
// Create a boundary so we know where to look for
// the start of the data
$boundary = uniqid("HTMLEMAIL");
// First we be nice and send a non-html version of our email
$headers .= "Content-Type: multipart/alternative;".
"boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n".
"Content-Type: text/plain; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode(strip_tags($HTML)));
// Now we attach the HTML version
$headers .= "--$boundary\r\n".
"Content-Type: text/html; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode($HTML));
// And then send the email ....
mail($to,$subject,"",$headers);
}
$HTML.= " <table width=\"100%\">
<tr>
<th><div align=\"left\" >when</div></th>
<th><div align=\"left\" >title</div></th>
<th><div align=\"left\" >location</div></th>
</tr>
<tr>
<td colspan=\"4\"><hr align=\"center\" size=\"1\" /></td>
</tr>
";while ($adslist=mysql_fetch_array($classifieds) ) {
$adurl="http://monsite.com/index.php?adid=".$adslist['id']."&catid=".$adslist['catid'];
$userprofile="http://monsite.com/index.php?userid=".$adslist['useridads'];
$HTML.="<tr><td>".$adslist['created']."</td>\n";
$HTML.="<td><a href=\"$adurl\"><h2>".strip_html_tags($adslist['headline'])."</h2></a> from <a href=\"$userprofile\">".$adslist['username']." </a></td>";
/*$message.="<td></td>";*/
//getting the location name
$town= str_replace (',','',$adslist['adcity']);
$location=mysql_query("select fieldtitle, fieldvalue from classify_field_values where fieldvalue='".$town."' ");
$myloc=mysql_fetch_array($location);
//end of query for location
$HTML.="<td>".$myloc['fieldtitle']." </td></tr>";
➡️ Offre MyRankingMetrics ⬅️
pré-audit SEO gratuit avec RM Tech (+ avis d'expert)
coaching offert aux clients (avec Olivier Duffez ou Fabien Faceries)
Voir les détails ici