$site = "http://127.0.0.1/website";
$webmaster = "<email@hotmail.com>";
$to = "$email";
$subject = "Your new password";
$message = "<html><body><p>Hello. Your password has been reset. Your new password is bellow</p><br/><p>Password : $pass</p><br/><a href='$site/activatePass.php?user=$user&password=$pass&code=$dbcode'>Acrivate</a><br/></body></html>";
$host = "smtp.live.com";
$port = "587";
$eusername = "email@hotmail.com";
$epassword = "password!";
$headers = array ('From' => $webmaster,'To' => $to,'Subject' => $subject, 'MIME-Version: 1.0', 'Content-type: text/html; charset=iso-8859-1');
$smtp =@ Mail::factory('smtp',
array ('host' => $host,'port' => $port,'auth' => true,'username' => $eusername,'password' => $epassword));
$mail = @$smtp->send($to, $headers, $message);
if (@PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo "Your password has been reset. An email has been sent with your new password to $email";
}
The code above is supposed to send an email to a person but in html. I have tried this for quite a while and i am not getting anywhere. if anyone could help me with this. that would be awesome.