In my newsletter module, the automatically generated reply email asking to confirm registration shows all the html tags, identically as what the whole piece of message basically looks in my php script...
You guys, do you know what I did wrong and how I can avoid that? I tested it with email accounts that do enable html tags, so it obviously comes from my script...
Here below is the piece of script found "guilty"...
function InviaMail($nome="", $mail="", $mittente="newsletter@site.com", $azione, $id) {
// Controllo che le varibili siano settate
if ( $nome=="" || $mail=="" ) {
echo "Can't find the e-mail!";
return 0;
}
$confirm = "http://".getenv(HTTP_HOST).dirname($_SERVER['SCRIPT_NAME'])."/confirm.php";
// sender's email
$dominio = $_SERVER['SERVER_NAME'];
// recipient's email
$destinatario = $mail;
// email's content
$messaggio = "";
if ( $azione == "registra" ) {
// this is where I hit a snag...
// the message below is shown as is.
$messaggio .= "Hello <strong>".$nome."</strong>!<br>".
"Thank you for joining<strong><a href='".$dominio."'>".$dominio."</a></strong> "."<font color='#ff0000'>'s Newsletter</font><br>".
"In order to validate your new subscription, you will need to click the following link"."<a href='".$confirm."?action=add&id=".$id."&nome=".md5($nome)."&mail=".md5($mail)."'>here</a>!<br><br>".
"Thank you!";
// email's title
$oggetto = "Submission to our Newsletter:".$dominio;
} elseif ( $azione == "elimina" ) {
$messaggio .= "Hello <strong>".$nome."</strong>!<br>".
"A delete action to newsletter of "."<strong><a href='".$dominio."'>".$dominio."</a></strong> ".
"We will delete your E-mail<br>".
"To confirm, click "."<a href='".$confirm."?action=delete&id=".$id."&nome=".md5($nome)."&mail=".md5($mail)."'>here</a>!<br><br>".
"Thank you!";
// email's title
$oggetto = "Deletion from our Newsletter:".$dominio;
}
Thanks!