How to send emails with Coresender API
When at least one sending account has been added to your Coresender account and you’ve verified a sending domain, you can now move on to integrate Coresender with your application.
For most people SMTP offers everything that is necessary. They want to get emails delivered with as little hassle as possible. If SMTP is all you need, here’s the guide on How to send emails with Coresender SMTP.
However, choosing API integration will give you more flexibility and more features. It will also be a lot faster for large volumes. Here's how to send a test message with Coresender API.
Step 1 - Grab your Sending account ID and an API Key
- Visit the Coresender user panel and click on Sending accounts, choose the sending account you want to use and click on it
- Click on API keys tab
- The Account ID and the API Key show like in the example on the screenshot below
Step 2 - Send a test message
You can use cURL to send a test email by pasting this simple code in Terminal:
Before you run the code, please replace the following:
- account_id - use your Account ID
- api_key - use your API key
- from.email - use an email address within your verified domain
- to.email - use any valid email address of your choice
If you run the code in terminal, you should see something like this:
In the example above, this is what we got:
- the message was accepted with no errors
- the message got its unique ID
- API request took 24ms to complete
The email looks in the inbox like this:
Because Coresender lets you track your messages, if you visit the Activity section of the Coresender control panel, this is what you’ll see:
Congratulations! You've sent your first message.
Now, you're ready to start testing Coresender using the free developer plan. Remember, you can request your organisation to be approved by Coresender at any moment so you can begin using the service in your production environment.