PHP Code:
<?php
$from = "DEFTEC <********@****.***>";// removed this email
$to = "********@****.***>"; // removed this email
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "********"; // Removed the host name
$username = "*********"; // hidden
$password = "*******"; // hidden
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = mail::factory('smtp'); // this is the line at fault added a ) and a ;
array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password); // took out the extra bracket
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
Looks to me like you have forgotten to include the PEAR file or you have just got fulgy code. I adjusted as needed.
__________________
My Blog/Site: Please login or register to view this content. Registration is FREE
Last edited by rogem002; 10-03-2008 at 09:23 AM..
|