{"id":54,"date":"2026-03-26T12:23:23","date_gmt":"2026-03-26T12:23:23","guid":{"rendered":"https:\/\/www.arnavsoftech.in\/blogs\/?p=54"},"modified":"2026-06-23T17:40:47","modified_gmt":"2026-06-23T12:10:47","slug":"sending-smtp-email-using-brevo-api-free","status":"publish","type":"post","link":"https:\/\/www.arnavsoftech.in\/blogs\/sending-smtp-email-using-brevo-api-free\/","title":{"rendered":"Sending SMTP email using Brevo api (FREE)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Brevo<\/strong> (formerly <em>Sendinblue<\/em>) is an <strong>all-in-one marketing &amp; communication platform<\/strong> that helps businesses send:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Emails (transactional + marketing)<\/li>\n\n\n\n<li>SMS \/ WhatsApp messages<\/li>\n\n\n\n<li>Automation campaigns<\/li>\n\n\n\n<li>CRM-based customer communication<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udc49 In simple words:<br>It\u2019s a <strong>tool to send emails and manage customers professionally<\/strong>, instead of relying on basic SMTP or Gmail. Sending an email using via Brevo API SMTP mails.  Follow the steps and full working codes. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\ude80 Step 1: Get Your Brevo API Key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login to Brevo <\/li>\n\n\n\n<li>Go to: <strong>SMTP &amp; API \u2192 API Keys<\/strong> <\/li>\n\n\n\n<li>Copy your <strong>v3 API key<\/strong> (Generate API key if not created)<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">\u2705 Step 2: Working PHP Code (Brevo API)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\n$fullName = 'a';\n$email = 'b@gmail.com';\n$service = 'c';\n$message = 'd';\n$phone = 'e';\n\nif ($fullName == '' || $email == '' || $phone == '' || $service == '' || $message == '') {\n    echo json_encode(&#91;'success' =&gt; false, 'message' =&gt; 'Please fill all the details']);\n    exit;\n}\n\n$html = \"&lt;p&gt;Dear Team &lt;br \/&gt;\nYou have received 1 email enquiry. &lt;br \/&gt;&lt;br \/&gt;\nName: $fullName &lt;br \/&gt;\nEmail: $email &lt;br \/&gt;\nPhone: $phone &lt;br \/&gt;\nService: $service &lt;br \/&gt;\nMessage: $message &lt;br \/&gt;&lt;br \/&gt;\nKindly Contact the sender. &lt;br \/&gt;Thank you.&lt;\/p&gt;\";\n\n\/\/ \u2705 Brevo API endpoint\n$url = \"https:\/\/api.brevo.com\/v3\/smtp\/email\";\n\n\/\/ \u2705 API payload\n$data = &#91;\n    \"sender\" =&gt; &#91;\n        \"name\" =&gt; \"Website Enquiry\",\n        \"email\" =&gt; \"youremail@gmail.com\" \/\/ must be verified in Brevo\n    ],\n    \"to\" =&gt; &#91;\n        &#91;\n            \"email\" =&gt; \"receiver-email@gmail.com\",\n            \"name\" =&gt; \"Receiver Name\"\n        ]\n    ],\n    \"replyTo\" =&gt; &#91;\n        \"email\" =&gt; $email,\n        \"name\" =&gt; $fullName\n    ],\n    \"subject\" =&gt; \"New Enquiry Details - Website\",\n    \"htmlContent\" =&gt; $html\n];\n\n\/\/ \u2705 cURL request\n$ch = curl_init();\n\ncurl_setopt_array($ch, &#91;\n    CURLOPT_URL =&gt; $url,\n    CURLOPT_RETURNTRANSFER =&gt; true,\n    CURLOPT_POST =&gt; true,\n    CURLOPT_POSTFIELDS =&gt; json_encode($data),\n    CURLOPT_HTTPHEADER =&gt; &#91;\n        \"accept: application\/json\",\n        \"api-key: YOUR_BREVO_API_KEY_HERE\",\n        \"content-type: application\/json\"\n    ],\n]);\n\n$response = curl_exec($ch);\n$error = curl_error($ch);\ncurl_close($ch);\n\n\/\/ \u2705 Response handling\nif ($error) {\n    echo json_encode(&#91;'success' =&gt; false, 'message' =&gt; $error]);\n} else {\n    $result = json_decode($response, true);\n    if (isset($result&#91;'messageId'])) {\n        echo json_encode(&#91;'success' =&gt; true, 'message' =&gt; 'Email sent successfully!']);\n    } else {\n        echo json_encode(&#91;'success' =&gt; false, 'message' =&gt; $response]);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Arnav Softech is also here to help you for your marketing automation and sending email work. We have good team to work on <a href=\"https:\/\/www.arnavsoftech.in\/services\/website-design-and-development\/\">Website Design Services<\/a> where you will get very good solution for your need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Brevo (formerly Sendinblue) is an all-in-one marketing &amp; communication platform that helps businesses send: \ud83d\udc49 In simple words:It\u2019s a tool <\/p>\n","protected":false},"author":1,"featured_media":267,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":17,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":268,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/posts\/54\/revisions\/268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/media\/267"}],"wp:attachment":[{"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.arnavsoftech.in\/blogs\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}