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 |
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://app.smtpprovider.com/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test%mail&body=%3Cp%3Ehappy%20birthday%3C%2Fp%3E&token=*****************', 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', )); $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." } }
var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://app.smtpprovider.com/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test mail&body=happy birthday
&token=*******************"); var content = new StringContent("", null, "text/plain"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync());
var options = new RestClientOptions("https://app.smtpprovider.com") { MaxTimeout = -1, }; var client = new RestClient(options); var request = new RestRequest("/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test mail&body=happy birthday
&token=*******************", Method.Post); var body = @""; request.AddParameter("text/plain", body, ParameterType.RequestBody); RestResponse response = await client.ExecuteAsync(request); Console.WriteLine(response.Content);
curl --location --request POST 'https://app.smtpprovider.com/api/send-mail?to=test%40example.com&from=info%40example.com&from_name=support&subject=test%20mail&body=%3Cp%3Ehappy%20birthday%3C%2Fp%3E&token=*******************' \ --data ''
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, ""); Request request = new Request.Builder() .url("https://app.smtpprovider.com/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test mail&body=happy birthday
&token=*******************") .method("POST", body) .build(); Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0); HttpResponseresponse = Unirest.post("https://app.smtpprovider.com/api/send-mail?to=test%40example.com&from=info%40example.com&from_name=support&subject=test%20mail&body=%3Cp%3Ehappy%20birthday%3C%2Fp%3E&token=*******************") .body("") .asString();
const raw = ""; const requestOptions = { method: "POST", body: raw, redirect: "follow" }; fetch("https://app.smtpprovider.com/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test mail&body=happy birthday
&token=*******************", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error));
var settings = { "url": "https://app.smtpprovider.com/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test mail&body=happy birthday
&token=*******************", "method": "POST", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
import http.client conn = http.client.HTTPSConnection("app.smtpprovider.com") payload = '' headers = {} conn.request("POST", "/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test%20mail&body=%3Cp%3Ehappy%20birthday%3C/p%3E&token=*******************", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
import requests url = "https://app.smtpprovider.com/api/send-mail?to=test@example.com&from=info@example.com&from_name=support&subject=test mail&body=happy birthday
&token=*******************" payload = "" headers = {} response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
var request = URLRequest(url: URL(string: "https://app.smtpprovider.com/api/send-mail?to=test%40example.com&from=info%40example.com&from_name=support&subject=test%20mail&body=%3Cp%3Ehappy%20birthday%3C%2Fp%3E&token=*******************")!,timeoutInterval: Double.infinity) request.httpMethod = "POST" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) } task.resume()
Copyright © 2024 All Rights Reserved