tp-mailer icon indicating copy to clipboard operation
tp-mailer copied to clipboard

ThinkPHP5.0.2手动安装提示找不到mailer\tp5\Mailer

Open xiaoxinpro opened this issue 8 years ago • 2 comments

根据文档将 tp-mailer 和 swiftmailer 文件夹复制到 extend 目录中,目录结构如下:

extend
├── tp-mailer
│   └── src
├── swiftmailer
│   ├── lib
│   ├── doc
│   └── tests

在模型中引用 use mailer\tp5\Mailer;

在方法中调用

        $mailer = Mailer::instance();
        $ret['mailer'] = $mailer->from('***@***.***','***')
            ->to($strEmail)
            ->subject($subject)
            ->html($html)
            ->send();

报错如下:

Class 'mailer\tp5\Mailer' not found

报错位置:

$mailer = Mailer::instance();

求解决方案,谢谢!

xiaoxinpro avatar Feb 01 '17 08:02 xiaoxinpro

我也遇到这个问题了!!怎么回事

backrobot avatar Mar 28 '18 01:03 backrobot

我写成这样了 $mailer=\mailer\tp5\Mailer::instance(); 还会提示:致命错误: Class 'mailer\tp5\Mailer' not found

backrobot avatar Mar 28 '18 01:03 backrobot