Well, their is a wrapper in laravel so I use just my domain like sandbox39495858577585.mailgun.org for the MAILGUN_DOMAIN and your MAIL_USERNAME should be something like postmaster@ sandbox39495858577585.mailgun.org. Mailgun gives you this info on their site. Your mail from info comes from config/mail.php...whatever you have in there.
Nov 9, 2016
8
Level 4
Mailgun not able to send email
I want guest users to send me feedbacks on my website. I used mailgun's api but I keep getting this error anytime I try to send mails. Client error:POST https://api.mailgun.net/v3//messages.mimeresulted in a404 NOT FOUND` response:
Not Found
The requested (truncated...)`
This is my mail.php
return [
'driver' => env('MAIL_DRIVER'),
'host' => env('MAIL_HOST'),
'port' => 587,
'from' => ['address' => '', 'name' => ''],
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env(MAIL_PASSWORD),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => env('MAIL_PRETEND', false),
];
This is my .env
MAIL_DRIVER=mailgun
MAIL_DOMAIN=sand*****************.mailgun.org
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=*************
MAIL_SECRET=key-*************************
MAIL_ENCRYPTION=tls
Service.php
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
],
Level 4
I intended to use gmail instead. I had a few problems with it but instead of setting the driver to smtp, i made it sendmail. and it worked.
Please or to participate in this conversation.