0

I have a Laravel 5.2 application, I need to send emails so I choose SparkPost as mail service. I configured the api_key, the driver, etc. But now I get this error:

Client error: `POST https://api.sparkpost.com/api/v1/transmissions` resulted in a `400 Bad Request` response:
{ "errors": [ { "message": "Invalid domain", "description": "No sending domain specified", "code": "7001" } ] }

I read that's because an invalid domain, so, it's not clear to me how to configure the domain if I don't have a domain, I just have a test server with an IP address 45.xxx.xxx.xxx or which options do I have to send mails?

Grokify
  • 15,092
  • 6
  • 60
  • 81
Sredny M Casanova
  • 4,735
  • 21
  • 70
  • 115

2 Answers2

1

You can test your system with add this to every email:

email + '.sink.sparkpostmail.com'

And I guess you also need add your domain. It is a domain of your FROM-email.

https://support.sparkpost.com/customer/portal/articles/2560839-how-do-i-test-using-the-sink-server-on-sparkpost

0

It sounds like the content.from field of your request is empty or missing.

The SparkPost transmissions endpoint expects content.from to contain an email address using a domain you own. That address then appears in the From: header of each email you send.

The usual path is to create a sending domain for this purpose on your account. Here's an article on how to do that.

For a quick test, you can use an address under the @sparkpostbox.com sandbox domain. Caveat: your account is limited to 50 emails addressed from sparkpostbox.com for the life of your account.

Ewan Dennis
  • 396
  • 1
  • 3