Bogardo / Mailgun

Mailgun package for Laravel
MIT License
295 stars 115 forks source link

Emails are not being sent or received. #160

Closed saffabook closed 5 years ago

saffabook commented 5 years ago

Hi there.

I have installed and followed instructions as directed, everything fires and seems to work, however no emails are being sent or received. I am using sandbox settings locally.

I have this as a test

Mailgun::raw("This is the email body", function ($message) {
       $message->to('mytestemail@gmail.com', 'John Doe')->subject('Welcome!');
});

I had a look to see if its running and had a look at the mailer.php and the response is as below.

$response = new Response($this->mailgun->post("{$domain}/messages", $message, $files));
object(Bogardo\Mailgun\Http\Response)#306 (4) {
  ["status"]=>
  int(200)
  ["data"]=>
  NULL
  ["message"]=>
  string(0) ""
  ["id"]=>
  string(0) ""
}

I have all the correct details in the .env file too, the mailgun set up also correct. I am wondering (and forgive my ignorance) but perhaps I might have missed something on this section.

$this->app->bind('mailgun.client', function() {
     return \Http\Adapter\Guzzle6\Client::createWithConfig([]); // what Guzzle6 configuration would I need?
 });

PS. I have tried this for Guzzle settings

return \Http\Adapter\Guzzle6\Client::createWithConfig([
    'headers' => [
        'Content-Type' => 'application/x-www-form-urlencoded'
    ]
]);

I appreciate your help.