Whether you need to send a few hundred emails or a few million, we’re ready to help you deliver your message. Are you ready to get started?
In Coresender, you can send emails using our SMTP server or with the API. In general, sending via API will give you some more advanced features down the road. In this article, we'll help you send your first email with Coresender API.
To send emails with Coresender, you will need your sending account created and your sending domain configured and verified. If you haven't done this already, please go to our Quickstart Start Guide and complete it first.
To communicate with the API, you will need a Sending account ID and an API key. Go to the Coresender control panel. Click on Sending accounts in the menu, and select one of your Sending accounts (you probably have one). On the details page you'll find your Sending account ID at the top and your API key in a "API keys" tab. Copy both strings, and you're ready to go.
Let's use curl
to send the first email. Head out to our API documentation and take a look at the Send email API. You'll find a sample code that showcases all features of this API. For this example, let's use a minimalistic version, though:
curl -X POST https://api.coresender.com/v1/send_email \
-u 'account_id:api_key' \
-d $'[
{
"from": {
"email": "[email protected]",
"name": "Jean-Luc Picard"
},
"to": [
{
"email": "[email protected]",
"name": "Geordi La Forge"
}
],
"subject": "I need engines",
"body": {
"text": "Geordi, I need engines, now!"
}
}
]'
Before running the code, replace account_id
and api_key
with the values you have obtained from the control panel. You also have to replace from.email
with an email address within your verified sending domain. The to.email
address can be any valid email address.
Let's run the code now and check the result:
{
"data": [{
"message_id": "7dd8eab0-ceca-4335-8291-5caffe329ef6",
"custom_id": "",
"status": "accepted",
"errors": []
}],
"meta": {
"rq_time": "0.0243s"
}
}
You can read a few things from the response:
Here's our email arriving at the recipient's inbox:
And here's the message timeline that you can find in Coresender's control panel:
You have just sent your first email with Coresender API. What you can do next: