to jest kod admin_transact.php
<?php require('config.php'); require('class.SimpleMail.php'); switch($_POST['action']) { case 'Dodaj nową listę mailingową': $sql = "INSERT INTO ml_lists (listname) " . "VALUES ('" .$_POST['listname']."')"; break; case 'Usuń listę mailingową': $sql = "DELETE FROM ml_lists WHERE ml_id=" . $_POST['ml_id']; $sql = "DELETE FROM ml_subscriptions " . "WHERE ml_id=" . $_POST['ml_id']; break; case 'Wyslij wiadomosć'; $sql = "SELECT listname FROM ml_lists" . "WHERE ml_id='" . $_POST['ml_id'] ."'"; $listname = $row['listname']; } else { $listname = "Główna"; } $sql = "SELECT DISTINCT usr.email,usr.firstname.usr.user_id " . "FROM ml_users usr " . "INNER JOIN ml_subscriptions mls" . "ON usr.user_id = mls.user_id " . "WHERE mls.pending=0"; if ($_POST['ml_id'] != 'all') { $sql .= "AND mls.ml_id=" .$_POST['ml_id']; } $headers = "From: " . ADMIN_EMAIL ."r\n"; $ft = "Otrzymujesz tą wiadomosć jako członek listy mailingowej"; $ft .= $listname .".\n Jeżeli uważasz, że ten list został "; $ft .= "wysłany pod zły adres lub\n chcesz usunąć "; $ft .= "swój adres z listy mailingowej, odwiedż poniższy "; $ft .= " link:\n"; $ft .= "http://" .$_SERVER['HTTP_HOST']. $row['user_id'] . "&ml=" . $_POST['ml_id']; } else { $ft = "Otrzymujesz tą wiadomosć bo zapisałes się do jednej"; $ft .= "lub wielu list mailingowych.\n Odwiedż poniższy "; $ft .= "link, aby zmienic ustawienia swojej subskrypcji:\n"; $ft .= "http://" . $_SERVER['HTTP_HOST'] . $row['user_id']; } $msg .= "--------------\n"; $msg .= $ft; $email = new SimpleMail(); $email->send($row['email'], $msg, $headers) } } break; } } ?>
i podaje tez ten drugi kod tej clasy na wszelki wypadek
<?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 wiadomosć wieloczęsciowa 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->message .= "--$_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--"; } } throw new Exception('Wysłanie listu zakończone niepowodzeniem.'); return FALSE; } else { return TRUE; } } } ?>
jezeli by mi ktos wyjasnil co musze poprawic bylbym wdzieczny pozdrawiam