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 pnpm 下载element-plus
  • ¥15 解决编写PyDracula时遇到的问题
  • ¥15 有没有人能解决下这个问题吗,本人不会编程
  • ¥15 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗