Email Notification

Send automated email alerts and notifications from your IoT devices. HTML templates, delivery tracking, and easy integration.

15 emails/day100 emails/monthView Docs

Get Started in Minutes

Start sending IoT notifications in just a few simple steps

1

Create Account

Sign up for free, no credit card required

2

Link Email Address

Add and verify your sender email address

3

View Templates

Browse and select an email template

4

Send Email

Call the API from your IoT device

Try API
Test the Email Notification directly from your browser
API Key:
cd_xxxxxxxxxxxxxxxxxxxx

No templates available

Select a template to fill its variables.

Email Preview

Select a template to preview

1// Tested with: ESP32 DevKit V1 / Generic ESP32
2#include <WiFi.h>
3#include <WiFiClientSecure.h>
4
5/* ================= WIFI DETAILS ================= */
6const char *ssid     = "YOUR_WIFI_SSID";
7const char *password = "YOUR_WIFI_PASSWORD";
8
9/* ================= EMAIL API DETAILS ================= */
10const char* host       = "www.circuitdigest.cloud";
11const char* apiKey     = "YOUR_API_KEY";
12const char* toEmail    = "YOUR_EMAIL_ADDRESS";
13const char* templateID = "Device Notification";
14
15/* ================= FLAG ================= */
16bool emailSent = false;
17
18/* ================= SEND EMAIL FUNCTION ================= */
19void sendEmail() {
20
21  if (WiFi.status() != WL_CONNECTED) {
22    Serial.println(" WiFi Not Connected!");
23    return;
24  }
25
26  WiFiClientSecure client;
27  client.setInsecure();
28
29  String apiUrl = "/api/v1/email/send";
30
31  Serial.println(" Connecting to Secure Server (HTTPS)...");
32
33  if (client.connect(host, 443)) {
34    Serial.println(" Connected to Cloud!");
35
36    String payload = "{";
37    payload += "\"to_email\":\"" + String(toEmail) + "\",";
38    payload += "\"template_id\":\"" + String(templateID) + "\",";
39    payload += "\"variables\":{";
40    payload += "\"title\":\"ESP32 Alert\",";
41    payload += "\"description\":\"Email sent using standard ESP32 Secure format.\",";
42    payload += "\"var1\":\"Hardware\",";
43    payload += "\"var2\":\"ESP32 DevKit\"";
44    payload += "}}";
45
46    client.println("POST " + apiUrl + " HTTP/1.1");
47    client.println("Host: " + String(host));
48    client.println("Authorization: " + String(apiKey));
49    client.println("Content-Type: application/json");
50    client.print("Content-Length: ");
51    client.println(payload.length());
52    client.println("Connection: close");
53    client.println();
54    client.println(payload);
55
56    Serial.println("\n Sending Email Payload...");
57
58    while (client.connected() || client.available()) {
59      if (client.available()) {
60        String line = client.readStringUntil('\n');
61        Serial.println(line);
62      }
63    }
64
65    client.stop();
66    Serial.println("\n Email Process Complete!\n");
67
68  } else {
69    Serial.println(" Connection to Email Server Failed!");
70  }
71}
72
73/* ================= SETUP ================= */
74void setup() {
75  Serial.begin(115200);
76  delay(2000);
77
78  Serial.println("Connecting ESP32 to WiFi...");
79  WiFi.begin(ssid, password);
80
81  while (WiFi.status() != WL_CONNECTED) {
82    delay(500);
83    Serial.print(".");
84  }
85
86  Serial.println("\n WiFi Connected!");
87  Serial.print("IP Address: ");
88  Serial.println(WiFi.localIP());
89
90  if (!emailSent) {
91    delay(3000);
92    sendEmail();
93    emailSent = true;
94  }
95}
96
97/* ================= LOOP ================= */
98void loop() {
99  // Do nothing
100}