Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wysyłanie maili przez PHP
smietek
post 24.01.2008, 07:15:26
Post #1





Grupa: Zarejestrowani
Postów: 306
Pomógł: 32
Dołączył: 20.01.2008

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


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)


--------------------
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
vokiel
post 24.01.2008, 07:59:49
Post #2





Grupa: Zarejestrowani
Postów: 2 592
Pomógł: 445
Dołączył: 12.03.2007

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


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.


--------------------
Go to the top of the page
+Quote Post
smietek
post 24.01.2008, 15:05:43
Post #3





Grupa: Zarejestrowani
Postów: 306
Pomógł: 32
Dołączył: 20.01.2008

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


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ć?


--------------------
Go to the top of the page
+Quote Post
-erbi-
post 27.01.2008, 23:29:02
Post #4





Goście







  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"
Go to the top of the page
+Quote Post
smietek
post 28.01.2008, 06:30:36
Post #5





Grupa: Zarejestrowani
Postów: 306
Pomógł: 32
Dołączył: 20.01.2008

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


Już sobie sam poradziłem przenosząc skrypt na inny serwer... Ale dzięki za chęci...


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 13.08.2025 - 23:04