dshw124502 2016-04-18 20:26
浏览 67
已采纳

Laravel - 404向Mailgun发送电子邮件时未发现错误

I have added the two TXT records to enable the sending of SMTP emails, and my account is now active.

My mail.php:

<?php

return [
    'driver' => 'mailgun',
    'host' => 'smtp.mailgun.org',
    'port' => '587',
    'from' => ['address' => 'nathan@*****', 'name' => 'Nathan ******'],
    'encryption' => 'tls',
    'username' => 'postmaster@auditing.*********.com',
    'password' => '*************************',
    'sendmail' => '/usr/sbin/sendmail -bs',
];

and services.php is:

'mailgun' => [
    'domain' => 'https://api.mailgun.net/v3/auditing.***********.com',
    'secret' => '**************************',
],

The error that I'm getting is:

Client error: `POST https://api.mailgun.net/v3/https://api.mailgun.net/v3/auditing.***********.com/messages.mime` resulted in a `404 NOT FOUND` response:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested (truncated...)

I originally had these in my .env file, but I put them directly into mail.php just to verify if it was a typo etc... It fails in both scenarios.

Am I missing anything? Looking at the 404 error, the domain it's trying to post to looks incorrect:

https://api.mailgun.net/v3/https://api.mailgun.net/v3/auditing.***********.com/messages.mime

Why is the https://api.mailgun.net/v3/ at the start?

Any help would be hugely appreciated.

  • 写回答

1条回答 默认 最新

  • duanjia9577 2016-04-18 20:36
    关注

    Your domain should only contain your personal domain provided by Mailgun, so try this:

    'mailgun' => [
        'domain' => 'auditing.***********.com',
        'secret' => '**************************',
    ],
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

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