dourukeng5302 2016-09-27 06:20
浏览 40

具有Yii2扩展名的Mailgun V3问题不存在端点

I am using https://github.com/boundstate/yii2-mailgun Yii2 extension for Mailgun and extending it on my wrapper class.

i configure as shown in documentation in web.php ,

'mailer' => [
            'class' => 'boundstate\mailgun\Mailer',
            'key' => 'key-85886fafb248373bd90a396',// valid key
            'domain' => 'sandbox5d98013abb1749fd94b68.mailgun.org',//valid domain
        ],

Now, when i am using it by,

Yii::$app->mailer->compose()
    ->setFrom('valid-email-address')
    ->setTo('valid-email-address')
    ->setSubject("test mail from mailgun api")
    ->send();

first , i got issue with SSL for my localhost.

GuzzleHttp\Exception\RequestException cURL error 60: SSL certificate problem: unable to get local issuer certificate ↵ Caused by: GuzzleHttp\Ring\Exception\RingException

there is no any configuration to set SSL => false through config as we can do with sendgrid extension.

and also i am facing this error after this,

Mailgun\Connection\Exceptions\MissingEndpoint The endpoint you've tried to access does not exist. Check your URL In mailgun Api , they are using "api.mailgun.net" ,although it throws such kind of error ..

Is there any solution for these two issues ??

  • 写回答

1条回答 默认 最新

  • douyi4544 2017-01-31 02:32
    关注

    Maybe you can read this issue in github first #130 and #175.

    To solve your problem you can manually add this line in your php.ini(based on Comment on that issues)

    [curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. curl.cainfo = "C:\php\extras\cacert.pem"

    Or you can use my way, by added it manually with instance Client adapter from guzzle like this. If you want use ssl, you can set verify to false

    use Http\Adapter\Guzzle6\Client;
    
     $httpClient = Client::createWithConfig([
      'verify' => __DIR__ . '/../config/ca-cert.pem'
    ]);
    
    $mailgun = new Mailgun(self::$apiKey, $httpClient);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作