";
$to = "efg ";
$subject = "Hi";
$html = ' efg\'s gift is waiting at e-gifts . Sign in and claim it. ';
$hdrs = array ('From' => $from,
'To' => $to,
'Subject' => $subject,
);
$mime = new Mail_mime();
$mime->setTXTBody(strip_tags($html));
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $hdrs, $body);
if (PEAR::isError($mail)) {
echo("" . $mail->getMessage() . " ");
} else {
echo("Message successfully sent! ");
}
?>
|