Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Codeigniter电子邮件在某些客户端中未呈现为html_Php_Codeigniter_Email - Fatal编程技术网

Php Codeigniter电子邮件在某些客户端中未呈现为html

Php Codeigniter电子邮件在某些客户端中未呈现为html,php,codeigniter,email,Php,Codeigniter,Email,我有一个web应用程序,通过CodeIgniter邮件库发送电子邮件 我收到报告说,一些客户收到的是电子邮件的源代码,而不是呈现的html。gmail的情况并非如此,它似乎工作正常 这显然是它在mac mail中的呈现方式 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Trans

我有一个web应用程序,通过CodeIgniter邮件库发送电子邮件

我收到报告说,一些客户收到的是电子邮件的源代码,而不是呈现的html。gmail的情况并非如此,它似乎工作正常

这显然是它在mac mail中的呈现方式

Content-Type: text/html; charset=utf-8

Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

 <html lang=3D"en">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
令人困惑的是,为什么只有一些客户机会这样渲染

编辑:

下面是发送电子邮件的PHP

接收它们的客户机也可以接收来自商店等的html电子邮件

private function sendQuoteEmail($id) {

    // Get request data based on $id and set variables for email

    $singleRecord = $this->vehicleRequests->fetch_by_id($id);

    $email = $singleRecord->email;

    $data = array(
        'id' =>$id,
        'name'=>$singleRecord->name,
        'price' =>$singleRecord->price,
        'make' =>$singleRecord->make,
        'model' =>$singleRecord->model
    );

    // Send the email
    $config['mailtype'] = 'html';
    $config['protocol'] = 'sendmail';
    //$config['charset'] = 'iso-8859-1';

    $this->email->initialize($config);

    $this->email->from('xxx@xxx.com', 'xxx');
    $this->email->to($email);
    $this->email->subject('Your Quote');

    $email = $this->load->view('email/quote_email', $data, TRUE);

    $this->email->message($email);

    $this->email->send();

}

听起来这是他们的电子邮件问题。你能问他们是否收到其他来源的HTML电子邮件吗?也许他们的偏好设置有误?如果它在GMAIL中正常工作,HTML就可以正常发布了,也许会发布显示为坏掉的原始电子邮件,那么生成它的PHP呢?现在任何人都能说的最好的一句话是“是的,它坏了。”@Sammitch-post已经更新,客户端可以很好地接收html电子邮件。但不是这个。不同的规则适用于不同的客户机/提供商<代码>1)GMAIL根本不允许使用样式表,一切都必须是内联样式。
2)Yahoo允许样式表。
3)两者偶尔都会将代码误解为恶意代码,您只会随机丢失样式声明。
此评论的要点是,除非您可以直接访问电子邮件,否则很难判断电子邮件客户端正在做什么客户也许在它进入他们的Mac之前就已经被解析了。如果我能接触到客户。我应该检查什么?我已经把它的外观包括在作品中了。
private function sendQuoteEmail($id) {

    // Get request data based on $id and set variables for email

    $singleRecord = $this->vehicleRequests->fetch_by_id($id);

    $email = $singleRecord->email;

    $data = array(
        'id' =>$id,
        'name'=>$singleRecord->name,
        'price' =>$singleRecord->price,
        'make' =>$singleRecord->make,
        'model' =>$singleRecord->model
    );

    // Send the email
    $config['mailtype'] = 'html';
    $config['protocol'] = 'sendmail';
    //$config['charset'] = 'iso-8859-1';

    $this->email->initialize($config);

    $this->email->from('xxx@xxx.com', 'xxx');
    $this->email->to($email);
    $this->email->subject('Your Quote');

    $email = $this->load->view('email/quote_email', $data, TRUE);

    $this->email->message($email);

    $this->email->send();

}