witam,
mam problem z kodem, gdyz wyskakuje mi taki błąd
Cytat
Warning: mail() expects at least 3 parameters, 1 given in /home/epaturi/domains/prowsiiz.pdg.pl/public_html/class.SimpleMail.php on line 70
Fatal error: Uncaught exception 'Exception' with message 'Wysyłanie listu zakończone niepowodzeniem.' in /home/epaturi/domains/prowsiiz.pdg.pl/public_html/class.SimpleMail.php:71 Stack trace: #0 /home/epaturi/domains/prowsiiz.pdg.pl/public_html/user_transact.php(75): SimpleMail->send('tomek@w...') #1 {main} thrown in /home/epaturi/domains/prowsiiz.pdg.pl/public_html/class.SimpleMail.php on line 71
a to jest kod z class.SimpleMail.php
<?php
class SimpleMail {
public $to = NULL;
public $cc = NULL;
public $bcc = NULL;
public $from = NULL;
public $subject = '';
public $body = '';
public $htmlbody = '';
public $send_text = TRUE;
public $send_html = FALSE;
private $message = '';
private $headers = '';
public function send($to = NULL,
$subject = NULL,
$message = NULL,
$headers = NULL) {
$this->to = $to;
$this->subject = $subject;
$this->message = $message;
if ($headers) {
$this->headers = $headers;
}
} else {
if ($this->from) {
$this->headers .= "From: " . $this->from . "r\n";
}
if ($this->cc) {
$this->headers .= "Cc: " . $this->cc . "r\n";
}
if ($this->bcc) {
$this->headers .= "Bcc: " . $this->bcc . "r\n";
}
if ($this->send_text and !$this->send_html) {
$this->message = $this->body;
} elseif ($this->send_html and !$this->send_text) {
$this->message = $this->htmlbody;
$this->headers .= "MIME-Version: 1.0r\n";
$this->headers .= "Content-type: text/html; " .
"charset=iso-8859-2r\n";
} else {
$_boundary = "==MP_Bound_xyccr948x==";
$this->headers = "MIME-Version: 1.0r\n";
$this->headers .= "Content -type: multipart/alternative; " .
"boundary=\"$_boundary\"r\n";
$this->message = "Jest to wiadomość wielocześciowa w " .
"formacie MIME\n";
$this->message .= "--$_boundary\n";
$this->message .= "Content-Type: text/plain: " .
"charset=\"iso-8859-2\"\n";
$this->message .= "Content-Transfer-Encoding: 8bit\n\n";
$this->message .= $this->body . "\n";
$this->nessage .= "--$_boundary\n";
$this->message .= "Content-type: text/html: " .
"charset=\"iso-8859-2\"\n";
$this->message .= "Content-Transfer-Encoding: 8bit\n\n";
$this->message .= $this->htmlbody . "\n";
$this->message .= "--$_boundary--";
}
}
if (!mail($this->to.$this->subject.$this->message.$this->headers)) { throw new Exception('Wysyłanie listu zakończone niepowodzeniem.');
return FALSE;
} else {
return TRUE;
}
}
}
?>