Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Wysyłanie maili przez PHP
Forum PHP.pl > Forum > Przedszkole
smietek
Napisałem prosty skrypt do wysyłania maili, jednak mam pewien problem. Kiedy np. w temacie lub w tekście wpisuje jakiś polski znak, na moją testową pocztę dochodzi taka wiadomość (mam pocztę na gmail.com):
Cytat
CORRUPTED MESSAGE

This is the Courier Mail Server 0.53 on v1.yoyo.pl.

I received the following message for delivery to your address. This message
contains several internal formatting errors. This is often caused by
viruses that attempt to infect remote systems. Instead of blocking
this message, I converted it to a safe, text-only attachment that can be
safely read with a text editor.

This sometimes also happens when the sender's mail software has a bug
that creates improperly-formatted messages. Although these kinds of
formatting errors may often be ignored by other mail servers, this
server detects and intercepts improperly-coded messages in order to
prevent viruses from taking advantage of bugs in E-mail programs:

-----------------------------------------------------------------------------
This message contains improperly-formatted binary content, or attachment.

See <URL:ftp://ftp.isi.edu/in-notes/rfc2045.txt> for more information.

To są znaczniki, które wysyłam:
Kod
$header = "MIME-Versio: 1.0\r\n"."Content-type: text/html; charset=ISO-8859-1\r\n";

A to sam mail()
Kod
mail($odbiorca, $temat, $content, $header)
vokiel
Skoro coś niedziała jak ktoś użyje polskich znaków, zatem to wina kodowania (ISO-8859-1).
ustaw kodowanie na: content="text/html; charset=iso-8859-2" albo najlepiej na utf-8 i powinno być dobrze.
smietek
Używałem ISO-8859-2, ale jest to samo. Używałem UTF-8 i jest nadal tak samo. Więco co mam ustawić?
erbi
  1. <?php
  2. $header = "MIME-Versio: 1.0r\n"."Content-type: text/html; charset=ISO-8859-1r\n";
  3. ?>


masz tu chyba blad w skladni, zgubiles literke "n" w "Version"
smietek
Już sobie sam poradziłem przenosząc skrypt na inny serwer... Ale dzięki za chęci...
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.