Sending an email

Prerequisites

You must complete the following within https://app.ohmysmtp.com:

  • Create an Organization
  • Create a Domain
  • Verify the domain
  • Sign up to a Plan

After following the onboarding steps all of these steps should be complete

Sending an email

The OhMySMTP is an HTTP API, to send an email you just need to call the /send endpoint with a standard HTTP POST request containing the authentication token, required headers and your email

The send endpoint is located at

https://app.ohmysmtp.com/api/v1/send

Examples

Here are some examples in various languages. For examples that contain your API key, open the Domain in the App and select "Examples" from the top menu bar

curl "https://app.ohmysmtp.com/api/v1/send" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "OhMySMTP-Server-Token: API_TOKEN_GOES_HERE" \
-d '{
"from": "example@domain.com",
"to": "person@somewhere.com",
"subject": "Hello from OhMySMTP.com",
"textbody": "Hello"
}'

The response

The response will come back using HTTP Status codes with a JSON body. If someonething went wrong (i.e. it does not return 200) an error object will be included to explain why. For full details of responses and their meaning see responses