Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: wysylanie maili
Forum PHP.pl > Forum > Przedszkole
Gość_janek_*
tak jak w temacie
Zastanawia mnie czy mogę wysyłać maile nie posiadająć własnego serwera pocztowego a wykorzystać już istniejące?questionmark.gif

znalazłem taki skrypt:

  1. <?php
  2. class eMail {
  3. var $to;
  4. var $subject;
  5. var $content;
  6. var $headers;
  7. var $marker;
  8. var $type;
  9. var $xMailer = "iGol Mail";
  10.  
  11. function eMail($type = "1", $from = "test<test@ktenbit.pl>", $replyto = "test <test@ktenbit.pl>")
  12. {
  13. $this->type = $type;
  14. $this->headers .= "From: " . $from . "n";
  15. $this->headers .= "Reply-to: " . $replyto . "n";
  16. $this->headers .= "X-Mailer: " . $this->xMailer . "n";
  17. $this->headers .= "MIME-Version: 1.0n";
  18. if ($type == 1) { // text/plain
  19. $this->headers .= "Content-Type: text/plain; charset=iso-8859-2n";
  20. } else {
  21. srand((double)microtime() * 1000000);
  22. $this->marker = md5(uniqid(rand()));
  23. $this->headers .= "Content-Type: multipart/mixed;n";
  24. $this->headers .= "tboundary="___" . $this->marker . "=="nn";
  25. $this->content = "--___" . $this->marker . "==n";
  26. $this->content .= "Content-Type: text/plain; charset="iso-8859-2"n";
  27. $this->content .= "Content-Transfer-Encoding: 8bitnn";
  28. } 
  29. } 
  30.  
  31. function eMailAttachment($mimeType, $fileName, $data)
  32. {
  33. if ($this->type != 1) {
  34. $this->content .= "nn--___" . $this->marker . "==n";
  35. $this->content .= "Content-Type: " . $mimeType . "; name="" . $fileName . ""n";
  36. $this->content .= "Content-Transfer-Encoding: base64n";
  37. $this->content .= "Content-Disposition: attachment; filename="" . $fileName . ""nn";
  38. $this->content .= chunk_split(base64_encode($data));
  39. } 
  40. } 
  41.  
  42. function eMailSend($to)
  43. {
  44. if ($this->type != 1) {
  45. $this->content .= "--___" . $this->marker . "==--nn"; // close marker
  46. } 
  47. mail ($to, $this->subject, $this->content, $this->headers);
  48. } 
  49.  
  50. function eMailContent($subject, $content)
  51. {
  52. $this->subject = $subject;
  53. $this->content .= $content;
  54. } 
  55. } 
  56.  
  57. ?>

niestety on nie działa działa i nie wiem jak to rozwiązać ;(
erix
Mozesz wysylac maile korzystajac z serwera smtp.
Poszukaj na www.phpclasses.org albo www.hotscripts.com.

Jest tego mase.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.