【问题标题】:Email CSV Attachment receives empty in Outlook 2013电子邮件 CSV 附件在 Outlook 2013 中接收为空
【发布时间】:2015-01-28 10:15:16
【问题描述】:

我仅在 Outlook 2013 中收到了无数据 CSV 附件电子邮件,但收到了包含 gmail 和其他邮件数据的 CSV。 我使用了以下 CakePHP 代码:

            $this->Email->reset();
            $fileatt = ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS;
            $this->Email->to =array('ram@xyz.com');
            $this->Email->cc =array('ram@gmail.com');
            $this->Email->subject = "CSV mail";
            $this->Email->from = "info@gmail.com";
            $this->Email->sendAs = 'html';
            $this->Email->filePaths  = array($fileatt);
            $this->Email->attachments =array("Sample.csv");
            $this->Email->charset = "utf-8";
            $this->Email->headerCharset = "utf-8";
            $message = "Hi Thanks!";
            $this->Email->send($message);

帮我解决这个问题。

【问题讨论】:

    标签: php email cakephp csv outlook


    【解决方案1】:

    您应该在附件中使用此代码

         $Email->attachments(array(
                'Sample.csv' => array(
                    'file' => WWW_ROOT.'img/doc/Sample.csv',
                    'mimetype' => 'text/csv',
                    'contentId' => 'my-unique-id'
                )
             ));
    

    【讨论】:

    • 这不起作用,我已经在其他邮件服务(gmail、yahoo)中收到了 csv 文件,但仍然收到了 Outlook 2013 的空 csv 文件。这是 Outlook 2013 上的问题吗?
    猜你喜欢
    • 2015-02-09
    • 2010-10-15
    • 1970-01-01
    • 2015-10-03
    • 2013-01-09
    • 1970-01-01
    • 2012-08-17
    • 2012-06-05
    • 1970-01-01
    相关资源
    最近更新 更多