No pongas la variable entre comillas simples .. así no se interpretará su valor ..
Código PHP:
<?php echo $contrasena; ?>
Pero .. lo que te vendría bien para tu caso es usar simplemente sintax tipo "Here doc":
Código PHP:
$shtml=<<<HTML
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="300" border="1">
<tr>
<td>HOLA </td>
</tr>
<tr>
<td>su nuevo password es: $contrasena</td>
</tr>
<tr>
<td>Gracias</td>
</tr>
</table>
</body>
</html>
HTML;
Más info:
http://www.php.net/manual/en/languag...syntax.heredoc
Un saludo,