Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Guten Tag zusammen,

ich verwende den folgenden bekannten Mailcode:

function mail_att($to, $subject, $message, $anhang)

{

$absender = "Mein Name";

$absender_mail = "ich@domain";

$reply = "antwort@adresse";

$mime_boundary="-----=" . md5(uniqid(mt_rand(), 1));

$header="From:" . $absender_reply_mail . "<" . $absender_reply_mail . ">\r\n";

$header.="Reply-To: " . $absender_reply_mail . "\r\n";

$header.="MIME-Version: 1.0\r\n";

$header.="Content-Type: multipart/mixed;\r\n";

$header.=" boundary=\"" . $mime_boundary . "\"\r\n";

$content="This is a multi-part message in MIME format.\r\n\r\n";

$content.="--" . $mime_boundary . "\r\n";

$content.="Content-Type: text/html charset=\"iso-8859-1\"\r\n";

$content.="Content-Transfer-Encoding: 8bit\r\n\r\n";

$content.=$message . "\r\n";

//$anhang ist ein Mehrdimensionals Array

//$anhang enthält mehrere Dateien

if (is_array($anhang) AND is_array(current($anhang)))

{

foreach ($anhang AS $dat)

{

$data = chunk_split(base64_encode($dat['data']));

$content.="--" . $mime_boundary . "\r\n";

$content.="Content-Disposition: attachment;\r\n";

$content.="\tfilename=\"" . $dat['name'] . "\";\r\n";

$content.="Content-Length: ." . $dat['size'] . ";\r\n";

$content.="Content-Type: " . $dat['type'] . "; name=\"" . $dat['name'] . "\"\r\n";

$content.="Content-Transfer-Encoding: base64\r\n\r\n";

$content.=$data . "\r\n";

}

$content.="--" . $mime_boundary . "--";

}

else //Nur 1 Datei als Anhang

{

$data=chunk_split(base64_encode($anhang['data']));

$content.="--" . $mime_boundary . "\r\n";

$content.="Content-Disposition: attachment;\r\n";

$content.="\tfilename=\"" . $anhang['name'] . "\";\r\n";

$content.="Content-Length: ." . $dat['size'] . ";\r\n";

$content.="Content-Type: " . $anhang['type'] . "; name=\"" . $anhang['name'] . "\"\r\n";

$content.="Content-Transfer-Encoding: base64\r\n\r\n";

$content.=$data . "\r\n";

}

if (@mail($to, $subject, $content, $header))

return true;

else

return false;

}

-----------------------------------------------------------------------

Anscheinend liegt hier irgendwo ein Fehler im Detail.

1.) Sende ich mit diesem Script - eine CSV Datei an eine Mail Adresse auf .gmx dann wird die Datei in der Übersicht mit einer Klammer angezeigt öffne ich die Mail dann ist kein Anhang mehr vorhanden und im Text stehen teile des Headers.

>>Text der Mail so wie es angezeigt wird:

Content-Type: text/html charset="iso-8859-1"

Content-Transfer-Encoding: 8bit

Text der Mail... (korrekt)

--------------------------------------------------------------------------------

Content-Disposition: attachment;

filename="2008-09-19_10-09-53-99999.csv";

Content-Length: .;

Content-Type: application/octet-stream; name="2008-09-19_10-09-53-99999.csv"

Content-Transfer-Encoding: base64

JFZLQjsgICAgICAgICAgICAgICAgICAgIDs5OTk5OQ0KJEFQUztCT047MQ0KJEFQUztSNzgwMDsx

OzszMTkuODU7DQo=

<< Ende Text der Mail.

2.) Schaue ich mir die Mail im Internet mit dem Webmail Programm Horde an (gesendet an eine andere Mail Adresse) dann sieht die Mail korrekt aus.

3.) Hole ich die Mail von 1.) oder 2.) mit Microsoft Outlook Express / Microsoft Outlook 2003 ab sieht die Mail aus wie unter 1.) beschrieben aus.

4.) Hole ich die Mail mit Thunderbird ab, dann soll Sie wohl in Ordnung sein. Konnte ich selbst noch nicht testen..

Kann mir hier irgendjemand einen Tipp geben.... Ich bin ratlos. Ich würde sagen das hier evtl. die Erkennung des Trenners der einzelnen Elemente nicht klappt ??

Danke und Gruß

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.