【问题标题】:CakePHP 1.3: How we can send email with 2 or more (file) attachments in cakephp?CakePHP 1.3:我们如何在 cakephp 中发送带有 2 个或更多(文件)附件的电子邮件?
【发布时间】:2012-10-29 07:52:27
【问题描述】:

我想通过 CakePHP 邮件发送一些图像文件。

目前我只对一个文件使用$this->Email->attachments = array($Path.$fileName); 我想在一封电子邮件中发送多个文件。

【问题讨论】:

    标签: cakephp cakephp-1.3 email-attachments


    【解决方案1】:

    它就像手册中描述的那样工作,只需向数组添加更多路径。

    http://book.cakephp.org/1.3/view/1638/Attachments

    $this->Email->attachments = array(
        $Path . $fileName,
        $Path . $someOtherFile
    );
    

    【讨论】:

    • 坦克很多。给你的参考。我用code $this->Email->attachments=array($this->data['form']['file0']['name']=>$this->data['form'][' file0']['tmp_name'],$this->data['form']['file1']['name']=>$this->data['form']['file1']['tmp_name' ]); code 谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-12
    • 1970-01-01
    • 2020-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-17
    相关资源
    最近更新 更多