空白电子邮件php

时间:2016-09-02 20:18:00

标签: php email

我的收件箱中有些电子邮件空白。我认为原因可能在源代码中。 左图是显示错误的图像。

Images

代码:

define( 'OWNER_EMAIL', 'leads@consorciomenegalli.com.br' );

define( 'DONOTREPLY_EMAIL', 'do-not-reply@consorciomenegalli.com.br' );

define( 'OWNER_NAME', 'Menegalli' );

case 'quote-form':   

    # put the email title here
    $title = 'Nova simulação via website';

    # email headers
    $headers = "MIME-Version: 1.0\n".
               "Content-type: text/html; charset=utf-8\n".
               "Content-Transfer-Encoding: 8bit\n".
               "From: ". $_POST['clientName'] ." <". $_POST['clientEmail'] .">\n".
               "Reply-to: ". $_POST['clientName'] ." <". $_POST['clientEmail'] .">\n".
               "Date: ". date( "r" ). "\n";

    # appointment values
    $values = $_POST['values'];

    # create rows with values from appointment form
    $rows = '';
    for( $i = 0; $i < count( $values ); $i++ ) {

        $rows .= '<tr>

                      <td style="width: 200px; font-weight: bold; border: 1px solid #eee; padding: 10px;">'. $values[$i]['name'] .'</td>
                      <td style="border: 1px solid #eee; padding: 10px;">'. $values[$i]['value'] .'</td>

                  </tr>';
    }

    # email content
    $content = '<table style="width: 600px; font-size: 11px; border-collapse: collapse;">'. $rows .'</table>';

    # sending an email
    $result = mail(
        OWNER_EMAIL,
        "=?UTF-8?B?". base64_encode( $title ) ."?=",
        $content,
        $headers
    );

    # if the email wasn't send
    if( $result == false ) {

        # second version of email
        mail(
            OWNER_EMAIL,
            "=?UTF-8?B?". base64_encode( EMAIL_TITLE ) ."?=",
            $content
        );
    }

break;

我认为该电子邮件未启动. $values[$i]['name'] .. $values[$i]['value'] .

0 个答案:

没有答案