-----
MODXのバージョン:1.0.23J
PHPのバージョン:7.3.20
MySQLのバージョン:5.0.12-dev
-----
元々の開発者の cfFormMailer v1.3 は動きませんでしたので、yamaさんがメンテされている cfFormMailer v1.6 を Github から拝借して使用しています。
config.ini では以下の設定をしています。
・自動返信あり(auto_reply = 1)
・自動返信はテキストメール(reply_ishtml = 0)
・HTMLタグ不使用(allow_html = 0)
このとき、管理者宛メールは届くのですが、自動返信メールが届かず以下のエラーを表示します。
Fatal error: Uncaught Error: Unsupported operand types in /home/httpd/vhosts/mydomain.com/httpdocs/assets/snippets/cfFormMailer/class.cfFormMailer.inc.php:668
どうやら、class.cfFormMailer.inc.php の 668 行目にある、$form_u + $additional が、型の違う値をくっつけようとしているというエラーらしいのです。
コード: 全て選択
        $pm->Body = mb_convert_encoding(
            $this->clearPlaceHolder(
                $this->replacePlaceHolder(
                    str_replace(
                        array("\r\n", "\r"),
                        "\n",
                        $tmpl_u
                    ),
                    $form_u + $additional, // <==ここでエラー
                    $this->config('allow_html') ? '<br />' : "\n"
                )
            ),
            $mailCharset,
            $this->config('charset')
        );
        $pm->Encoding = '7bit';
おそらく 653~659行がそれに当たり、
コード: 全て選択
        if ($this->config('reply_ishtml')) {
            if ($this->config('allow_html')) {
                $form_u = $this->nl2br_array($this->form);
            } else {
                $form_u = $this->encodeHTML($this->form, 'true');
            }
        }ですので、似たようなコードになっている「管理者宛メールの本文生成」部分(530行目)を参考に、653行目の前に以下のコードを追加してみました。
コード: 全て選択
653行目 $form_u = $this->form;これが正しいコードかはわかりませんので、後日 yama さんに検証&修正をしていただけましたら幸いです。
よろしくお願いします。
				