E-posta mailservers için 990 karakter sınırlaması için geçici çözüm

0 Cevap php

Benim html bu nedeniyle etkilenir ediliyor gibi e-posta için 990 karakter sınırlaması ile yardımcı olmak için herhangi işlevleri / sınıfları / etc .. olup olmadığını bilmek istiyordu.

Sorun: (Source)

Note that mailservers have a 990-character limit on each line contained within an email message. If an email message is sent that contains lines longer than 990-characters, those lines will be subdivided by additional line ending characters, which can cause corruption in the email message, particularly for HTML content. To prevent this from occurring, add your own line-ending characters at appropriate locations within the email message to ensure that no lines are longer than 990 characters.

Başkasının bu sorunu var gibi görünüyor? ve nasıl düzeltebilirim ki?

Ben HTML bölmek ve elle satır sonu eklemek, öf için iyi bir yer bulmak gerekir gibi geliyor ...

GÜNCELLEME:

Birçok satır ile tablatura veri bulunuyor. Yani bir \ n veya <br /> yere eklemeniz gerekiyor?

GÜNCELLEME 2: MIME Türü Kod Ekleme

$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: quoted-printable\r\n"; // added this, but still no results
$headers .= "From: from@email.com\r\n";

İşte işlev (ler) arıyorum nasıl:

Ben aslında denilen nasıl:

return $html;

Ne denedim:

return imap_8bit($html); // not working, nothing is captured in the error log

VE

return imap_binary($html); // not working, nothing is captured in the error log

GÜNCELLEME # 3 (ekleme Posta İşlevi)

try {
    mail(
        'to@email.com',
        'Subject of Email',
        $html,
        $headers
        );
    } catch (Exception $e) {
        echo ("ERROR: Email NOT sent, Exception: ".$e->getMessage());
    }

Örnek HTML (Bu HTML e-posta mesajı) (Bu bir XMLRPC hizmetin parçası olan bir sınıfta aynı zamanda)

private function getHTML() {
    $html  = '<html><head><title>Title</title></head><body>';
    $html .= '<table>';
    $html .= '<tr><td>many many rows like this</td></tr>';
    $html .= '<tr><td>many many rows like this</td></tr>';
    $html .= '<tr><td>many many rows like this</td></tr>';
    $html .= '<tr><td>many many rows like this</td></tr>';
    $html .= '<tr><td>many many rows like this</td></tr>';
    $html .= '</table>';
    $html .= '</body>';
    $html .= '</html>';

    return $html;
    //return imap_8bit($html); // not working, nothing is captured in the error log
    //return imap_binary($html); // not working, nothing is captured in the error log
    // Both of these return the XMLRPC Fault Exception: 651 Failed to parse response
}

İstisna Arıza: 651, temelde veri döndürdü nasıl biçimi gibi ya da değil yanıtını ayrıştırma başarısız oldu.

0 Cevap