Como dijo 'jerkan', $toaddress que valor almacena ?
Para enviar email con php yo configure mi php.ini colocando en
Código PHP:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
esto
Código PHP:
[mail function]
; For Win32 only.
SMTP = mi.servidor.de.email
smtp_port = 25
; For Win32 only.
sendmail_from = cuentaEMAILqueEnviaElemail
y despues el codigo php que manda el email seria este
Código PHP:
$para="[email protected]";
//Asunto
$asunto="Email enviado desde php";
//Mensaje
$mensaje='
<html>
<head>
<title> Probando email desde php </title>
</head>
<body>
<h1> TITULO EMAIL PHP </h1>
<p> Esto es un email desde php con url </p><br>
<a href="http://www.google.es">google</a><br>
<p> Fin email html con php </p>
</body>
</html>
';
//Cabeceras
$cabeceras = 'MIME-Version: 1.0' . "\r\n";
$cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//Enviar email
mail($para, $asunto, $mensaje, $cabeceras);
modificando este codigo php con los valores que recoges pues ya lo tendrias casi listo.