Jeśli tekst jest wpisany statycznie i nie ma zadeklarowanych zmiennych php, to po przyjściu maila jest tak jak powinno byc - wiadomośc + załącznik.
Jeśli natomiast dodam pierwsze 16 linijek poniższego kodu, to zamiast tworzyc maila z załącznikiem, przesyła mi maila z kodem źródłowym, bez załącznika.
Bez względu czy ustawię kodowanie strony na ANSI czy utf8 zawsze jest tak samo.
W czym tkwi błąd i jak go naprawic?
Oto kod:
<?php //session_start(); include('funkcje.php'); //$db=polaczMy(); $nazwa = $_POST['nazwa']; $vorname= $_POST['vorname']; $strasse = $_POST['strasse']; $kod = $_POST['kod']; $tel = $_POST['tel']; $mail = $_POST['mail']; $datum_od = $_POST['datum_od']; $datum_to = $_POST['datum_to']; $ort = $_POST['ort']; $zeit = $_POST['zeit']; $mietteilung = $_POST['mietteilung']; $service = $_POST['service']; $to = 'jakis@mail.com'; $subject = 'Anfrage'; $headers = "From: xxx r\n"; $headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\""; $attachment = "BEGIN:VCARD VERSION:3.0 N:".$vorname.";;;; FN:".$vorname." ORG:".$nazwa." ADR;TYPE=work:;;".$strasse.";".$ort.";;; EMAIL;type=INTERNET;type=WORK;type=internet:".$mail." TEL;type=WORK;type=pref:".$tel." END:VCARD"; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h2>Hello World!</h2> <p>This is something with <b>HTML</b> formatting.</p> Content-Type: text/vcard; name="attachment.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment <?php //copy current buffer contents into $message variable and delete current output buffer //send the email //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" ?>
Pozdrwiam