electricphp
Programmer
I am trying to set the format of this email as html instead of plain text, but I can't figure out how to do it. Maybe you guys can help:
Code:
require_once "../pearmail/Mail.php";
$from = "aaaa <info@aaaaa.com>";
$to = "aaaa@daaaa.com"; ;
$subject = "aaaaa.com, a message from ".$_POST['name'];
$body = Hello ". $_POST['fname'].", ".$_POST['name']." wants you to check out the following webpage:<a href='aa.com'>".$_POST['pg']."</a>";
$host = "localhost";
$username = "info@aaaa.com";
$password = "aaaaaa";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
}