require_once "Mail.php";

$from = "biuro@kartex.eu";
$to = "biuro@kartex.eu";
$subject = "Temat!";
$body = "Tresc wiadomosci?";

$host = "az0031.srv.az.pl"; // np. smtp.wp.pl
$username = "biuro@kartex.eu";
$password = "agyz691021";

//reszty mozna nie ruszac

$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>Wiadomosc wyslana!</p>");
}