Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] mail nie działa, błąd z php mail
simman
post
Post #1





Grupa: Zarejestrowani
Postów: 21
Pomógł: 0
Dołączył: 23.05.2007

Ostrzeżenie: (10%)
X----


Cześć

chce skorzystać z funkcji mail ale coś mi nie działa. Proszę o rady.

Sprawdziłem mam ustawione 25
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\mail2\index.php on line 43

korzystam z gotowca ze strony php na moim localhost WAMP 2.0

Wpisałem tylko gdzie ma zostać wysłane (IMG:style_emoticons/default/smile.gif)
Kod
<?php
// kilku odbiorców
$to  = 'sebekss@wp.pl' . ', '; // zwróćmy uwagę na przecinek
$to .= 'sebekss@wp.pl';

// temat
$subject = 'Birthday Reminders for August';

// wiadomość
$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
';

// Aby wysłać e-mail HTML, musi być ustawiony nagłówek Content-type
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Dodatkowe nagłówki
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

// Wysłanie e-maila
mail($to, $subject, $message, $headers);
?>

Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Nh2003
post
Post #2





Grupa: Zarejestrowani
Postów: 81
Pomógł: 14
Dołączył: 3.10.2007

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


Zapoznaj sie najpierw co robi ten program a potem dopiero przylatuj na forum o pomoc.

Cytat
Test Mail Server Tool is a full featured mail (SMTP) server emulation to test mail sending capabilities of a web or desktop application or to preview messages before they are actually sent. This is a great tool for web programmers or application developers who need mail server for tests but don't want to install one.


Program UDAJE ze jest serwerem, przechwytuje maile ale ich nie wysyla. Nie jest to serwer SMTP tylko emulator serwera.
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: 6.09.2025 - 00:57