Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wysyłanie emaila, Jak skonfigurować? Funkcja jest poprawna?
sadistic_son
post
Post #1





Grupa: Zarejestrowani
Postów: 1 495
Pomógł: 245
Dołączył: 1.07.2009
Skąd: Bydgoszcz

Ostrzeżenie: (0%)
-----


Mam problem z wysyłaniem maili.

  1. <?php
  2. function sendMail($email, $subject, $content, $replyTo=null)
  3.    {
  4.        $header="From: adres@wp.plr\n";
  5.        if(!is_null($replyTo)) $header.="Reply-to: $replyTor\n";
  6.        $header.="Mime-Version: 1.0r\n";
  7.        $header.="Content-type: text/html; charset=ISO-8859-2r\n";
  8.         $header.="Content-Transfer-Encoding: 8bitr\n";
  9.  
  10.        $subject=iconv("UTF-8","ISO-8859-2", $subject);
  11.        $subject='=?iso-8859-2?B?'.base64_encode($subject).'?=';
  12.  
  13.        $footer='stopka';
  14.        $content=iconv("UTF-8","ISO-8859-2", $content.$footer);
  15.  
  16.        mail($email, $subject, $content, $header);    
  17.    }
  18.    
  19. sendMail($email,$subject,$content,$replyTo=null);
  20. ?>


Po odpaleniu stronki pojawia się error:

Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.wp.pl" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xxx\mail.php on line 17


php.ini wygląda następująco:

[mail function]
; For Win32 only.
SMTP = smtp.wp.pl
smtp_port = 25

; For Win32 only.
sendmail_from = adres@wp.pl


Co jest nie tak? Czego brakuje?

Dzięki.

Ten post edytował sadistic_son 11.07.2009, 19:31:40
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 08:58