URL: https://app.smtpprovider.com/api/send-mail/
Field | Type | Description | Required |
---|---|---|---|
to | string | Email id of the user where you want to send email. | Y |
from | string | Email id of the sender. | Y |
from_name | string | Name of the sender. | Y |
subject | string | Subject you want to send with the email. | Y |
body | string | HTML template of the email. | Y |
token | string | Unique API Tokens provided in profile page. | Y |
$data = [ 'to' => 'test@example.com', 'from' => 'info@example.com', 'from_name' => 'test', 'subject' => 'test mail', 'body' => "test mail body", 'token' => '*************', ]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://app.smtpprovider.com/api/send-mail', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $data, )); $response = curl_exec($curl); curl_close($curl); echo $response;
Success Response:
{ "success": 1, "message_id": "mid-5739b9aa57df91a117476d030d38246c@akoneseo.com" }
Error Response:
{ "success": false, "data": { "message": "User Not Exist." } }
Copyright © 2024 All Rights Reserved