Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML]mailing z dedyka
rybenia
post
Post #1





Grupa: Zarejestrowani
Postów: 112
Pomógł: 0
Dołączył: 5.04.2008

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


Jeśli chcę wysłać mailing z serwera dedykowanego wywala mi następujący błąd.



Kod
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\mail\mail6.php on line 16


  1. <?php error_reporting(E_ALL | E_USER_WARNING);
  2. $headers  = "MIME-Version: 1.0\n";
  3. $headers .= "Content-type: text/html; charset=iso-8859-2\n";
  4. $headers .= "Content-Transfer-Encoding: quoted-printable\n";
  5. $file_name = $_GET['plik'].".txt";
  6. $twoj_mail = $_GET['twoj_mail'];
  7. $file = fopen($file_name, 'r');
  8. $topic = $_GET['topic'];
  9. $text = $_GET['text'];
  10. $i=0;
  11. $max_mails = 100000;
  12. while(!feof($file) && $i <= $max_mails){
  13. $i++;
  14. $file_read = fgets($file);
  15. $file_read = trim($file_read);
  16. $mail = mail($file_read, $topic, $text, $headers);
  17. if($mail){
  18. echo $i.' - mail wyslany: '.$file_read.'!<br />';
  19. } else {
  20. echo $i.' - blad podczas wysylania maila na adres: '.$file_read.'<br />';
  21. }
  22. }
  23. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Foxx
post
Post #2





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


No to ustaw opcję w php.ini
Cytat
"sendmail_from" not set in php.ini
Go to the top of the page
+Quote Post
rybenia
post
Post #3





Grupa: Zarejestrowani
Postów: 112
Pomógł: 0
Dołączył: 5.04.2008

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


w tej lini mam tylko email moj wpisać?
Go to the top of the page
+Quote Post
erix
post
Post #4





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Nie musisz koniecznie w php.ini. Ustaw ten adres w nagłówku From w zmiennej $headers i też będzie ok.
Go to the top of the page
+Quote Post

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: 23.12.2025 - 04:58