先日リリースされたSOY Inquiry0.9.6 をロリポップサーバーにインストールしたときに発生したトラブルの対処法をメモしておきます。
php.iniの設定は予め「safe_mode off」にしています。
で、テスト送信の結果がこれ。
Warning: Missing argument 5 for MailLogic::sendMail(), called in /home/users/2/lolipop.jp-xxxxxxxx/web/test/app/webapp/inquiry/pages/Config/IndexPage.class.php on line 260 and defined in /home/users/2/lolipop.jp-xxxxxxxx/web/test/app/webapp/inquiry/src/logic/MailLogic.class.php on line 77
Warning: Cannot modify header information - headers already sent by (output started at /home/users/2/lolipop.jp-xxxxxxxx/web/test/app/webapp/inquiry/src/logic/MailLogic.class.php:77) in /home/users/2/lolipop.jp-xxxxxxxx/web/test/common/lib/soy2_build.php on line 294
上記のエラー内容を読み解くと「/inquiry/pages/Config/IndexPage.class.php」の260行目、MailLogic::sendMail()の引数が間違ってるよ。
MailLogic::sendMail()は「/inquiry/src/logic/MailLogic.class.php」の77行目に定義されてるよって。
で実際にソースコードがどうなっていたかというと「/inquiry/pages/Config/IndexPage.class.php」の260行目は
$mailLogic->sendMail($to,$title,$body,$label);
「/inquiry/src/logic/MailLogic.class.php」の77行目は
function sendMail($sendTo,$title,$body,$sendToName,$replyTo){
たしかに引数の数が違いますね。$replyToがありません。
ソースコードの変更は「/inquiry/pages/Config/IndexPage.class.php」の260行目のほうに行います。要は引数を1つ増やしてあげるだけですね。
$mailLogic->sendMail($to,$title,$body,$label,null);
$replyToにあたる変数が近くに見当たりませんので、ひとまず「null」を渡してみての実験。で、エラーが消えてテストメールが送信されました。チャンチャン。
投稿日: