Giter VIP home page Giter VIP logo

tp-mailer's People

Contributors

yuan1994 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tp-mailer's Issues

ThinkPHP3.2.3报错:Method name must be a string,求解答

错误位置
FILE: D:\phpStudy\WWW\joa\Txp\Library\Vendor\tp-mailer\src\mailer\lib\Transport.php  LINE: 120

控制器头部引用:
namespace Home\Controller;
use Think\Controller;
require_once 'Txp/Library/Vendor/tp-mailer/src/autoload.php';
use mailer\tp32\Mailer;

控制器方法部分:
$mailer = Mailer::instance();
$mailer->from('@163.com', 'WJOA邮件网关')
->to('
@qq.com')
->subject('纯文本测试')
->text('欢迎您使用Tp Mailer')
->send();

TP5.1 Non-static method think\Config::get() should not be called statically

}

/**
 * 自动探测配置项
 */
private static function detect()
{
    if (class_exists('\\think\\Config')) {
        // thinkphp5自动探测初始化配置项
        self::$config = \think\Config::get('mail');
    } elseif (function_exists('C')) {
        // thinkphp3自动探测初始化配置项
        self::$config = C('mail');
    } else {
        // 其他框架如果未初始化则抛出异常
        throw new InvalidArgumentException('未初始化配置项,请使用 mail\\lib\\Config::init()初始化配置项');
    }
}

}

你好...一直报这个错..该如何解决呢

[0] ThrowableError in Transport.php line 120
致命错误: Method name must be a string

} elseif (is_string($driverName)) {
          // 驱动为字符串,为内置驱动
          $driver = 'create' . ucfirst($driverName) . 'Driver';
          if (!method_exists($this, $driver)) {
              throw new BadMethodCallException("Mailer driver {$driverName} not exist");
          }
      }
      return $this->$driver();
  }
}

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

根据文档将 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();

求解决方案,谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.