Trying to build a code to send password reset link through email in response to those who request it. The email is received on hotmail and gmail, but not on particular mail client I do not know the configuration. Of course, I tried several arrangements regarding the quotes and doubles-quotes, but it did not give anything.
<?php
$site = "http://www.example.fr";
$from = "info@example.fr";
$nom = "DLSS";
$limite = "_----------=_parties_".md5(uniqid (rand()));
$sujet = "Password Reset";
$text = "Please click on this <a href=\"http://www.example.fr/dlss/login/verif.php?eml=".$eml."&cod=".$cod."\">link</a> to initialize your password.";
$html = "Please click on this <a href=\"http://www.example.fr/dlss/login/verif.php?eml=".$eml."&cod=".$cod."\">link</a> to initialize your password.";
$from = $nom." <".$from.">";
$header = "From: ".$from."
";
$header .= "Reply-to: ".$from."
";
$header .= "Return-Path: ".$from."
";
$header .= "Organization: ".$nom."
";
$header .= "X-Sender: <".$site.">
";
$header .= "X-Mailer: PHP/".phpversion()."
";
$header .= "X-auth-smtp-user: ".$from."
";
$header .= "X-abuse-contact: ".$from."
";
$header .= "Date: ".date("D, j M Y G:i:s O")."
";
$header .= "MIME-Version: 1.0
";
$header .= "Content-Type: multipart/alternative; boundary=\"".$limite."\"";
$message = "";
$message .= "--".$limite."
";
$message .= "Content-Type: text/plain
";
$message .= "charset=\"iso-8859-1\"
";
$message .= "Content-Transfer-Encoding: 8bit
";
$message .= $text;
$message .= "
--".$limite."
";
$message .= "Content-Type: text/html; ";
$message .= "charset=\"iso-8859-1\"; ";
$message .= "Content-Transfer-Encoding: 8bit;
";
$message .= $html;
$message .= "
--".$limite."--";
mail($eml, $sujet, $message, $header);
?>
In summary, the email is received by this particular mail client when I replace these two lines there :
$text = "Please click on this <a href=\"http://www.example.fr/dlss/login/verif.php?eml=".$eml."&cod=".$cod."\">link</a> to initialize your password.";
$html = "Please click on this <a href=\"http://www.example.fr/dlss/login/verif.php?eml=".$eml."&cod=".$cod."\">link</a> to initialize your password.";
With these two lines here :
$text = "Test Email with link. <a href=\"http://www.example.fr\">link</a>";
$html = "Test Email with link. <a href=\"http://www.example.fr\">link</a>";
Or with these two lines here :
$text = $eml . " - " . $cod;
$html = $eml . " - " . $cod;
Finally, the problem is in the combination of these two parts that are the web address and the two variables, it's been three days that I try to solve this problem but I can not do it alone, it would be really nice to have help, Thanks in advance !
</div>