Get the most out of your email marketing efforts with Open-AI GPT powered Content Creation and leading 95% Deliverability!
Every business selected to participate in the preview release will receive up to $1000 credit
Thank you for signing up!
We appreciate your feedback and support
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const fetch = require('node-fetch');
const url = 'https://api.mailpass.app/v1/email';
const headers = {
accept: 'application/json',
Authorization: 'Bearer [YOUR API KEY]',
'Content-Type': 'application/json'
};
const body = {
from: {
email: 'your.email@example.com',
name: 'Your Name'
},
to: [{
email: 'recipient.email@example.com',
name: 'Recipient Name'
}],
subject: 'Greetings from MailPass!',
text: 'This awesome message is brought to you by MailPass.',
html: '<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>'
};
fetch(url, { method: 'POST', headers, body: JSON.stringify(body)})
.then((response) => response.json())
.then((data) => {
console.log('Email sent successfully', data);
})
.catch((error) => {
console.error('Error sending email', error);
});
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
url = "https://api.mailpass.app/v1/email"
headers = {
"accept": "application/json",
"Authorization": "Bearer [YOUR API KEY]",
"Content-Type": "application/json"
}
body = {
"from": {
"email": "your.email@example.com",
"name": "Your Name"
},
"to": [{
"email": "recipient.email@example.com",
"name": "Recipient Name"
}],
"subject": "Greetings from MailPass!",
"text": "This awesome message is brought to you by MailPass.",
"html": "<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>"
}
response = requests.post(url, headers=headers, json=body)
if response.status_code == 200:
print("Email sent successfully")
else:
print(f"Error sending email: {response.status_code} {response.reason}")
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'net/http'
require 'json'
url = URI("https://api.mailpass.app/v1/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer [YOUR API KEY]'
request["content-type"] = 'application/json'
request.body = {
from: {
email: 'your.email@example.com',
name: 'Your Name'
},
to: [{
email: 'recipient.email@example.com',
name: 'Recipient Name'
}],
subject: 'Greetings from MailPass!',
text: 'This awesome message is brought to you by MailPass.',
html: '<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>'
}.to_json
response = http.request(request)
if response.code == '200'
puts 'Email sent successfully'
else
puts "Error sending email: #{response.code} #{response.message}"
end
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
httpposturl := "https://api.mailpass.app/v1/email"
var jsonData = []byte(`{
"from": {
"email": "your.email@example.com",
"name": "Your Name"
},
"to": [{
"email": "recipient.email@example.com",
"name": "Recipient Name"
}],
"subject": "Greetings from MailPass!",
"text": "This awesome message is brought to you by MailPass.",
"html": "<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>"
}`)
request, error := http.NewRequest("POST", httpposturl, bytes.NewBuffer(jsonData))
request.Header.Set("Content-Type", "application/json; charset=UTF-8")
client := &http.Client{}
response, error := client.Do(request)
if error != nil {
panic(error)
}
defer response.Body.Close()
body, _ := ioutil.ReadAll(response.Body)
fmt.Println("Email sent successfully", string(body))
}
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$url = 'https://api.mailpass.app/v1/email';
$headers = array(
'accept: application/json',
'Authorization: Bearer [YOUR API KEY]',
'Content-Type: application/json'
);
$body = array(
'from' => array(
'email' => 'your.email@example.com',
'name' => 'Your Name'
),
'to' => array(
array(
'email' => 'recipient.email@example.com',
'name' => 'Recipient Name'
)
),
'subject' => 'Greetings from MailPass!',
'text' => 'This awesome message is brought to you by MailPass.',
'html' => '<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>'
);
$request = new HttpRequest();
$request->setMethod(HTTP_METH_POST);
$request->setUrl($url);
$request->setHeaders($headers);
$request->setContent(json_encode($body));
try {
$response = $request->send();
echo 'Email sent successfully: ' . $response->getBody();
} catch (HttpException $ex) {
echo 'Error sending email: ' . $ex->getMessage();
}
?>
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) throws IOException {
URL url = new URL("https://api.mailpass.app/v1/email");
Map<String, String> headers = Map.of(
"accept", "application/json",
"Authorization", "Bearer [YOUR API KEY]",
"Content-Type", "application/json"
);
JSONObject body = new JSONObject()
.put("from", new JSONObject()
.put("email", "your.email@example.com")
.put("name", "Your Name"))
.put("to", new JSONArray().put(new JSONObject()
.put("email", "recipient.email@example.com")
.put("name", "Recipient Name")))
.put("subject", "Greetings from MailPass!")
.put("text", "This awesome message is brought to you by MailPass.")
.put("html", "<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
for (Map.Entry<String, String> header : headers.entrySet()) {
connection.setRequestProperty(header.getKey(), header.getValue());
}
connection.setDoOutput(true);
try (OutputStream output = connection.getOutputStream()) {
output.write(body.toString().getBytes());
}
int statusCode = connection.getResponseCode();
if (statusCode == 200) {
System.out.println("Email sent successfully");
} else {
System.out.println(String.format("Error sending email: %d %s", statusCode, connection.getResponseMessage()));
}
}
}
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace MailPass {
class Program {
static void Main(string[] args) {
string url = "https://api.mailpass.app/v1/email";
var headers = new WebHeaderCollection {
{
"accept",
"application/json"
}, {
"Authorization",
"Bearer [YOUR API KEY]"
}, {"Content-Type", "application/json"}
};
var body = new {
from = new {
email = "your.email@example.com",
name = "Your Name"
},
to = new[]{
new {
email = "recipient.email@example.com",
name = "Recipient Name"
}
},
subject = "Greetings from MailPass!",
text = "This awesome message is brought to you by MailPass.",
html = "<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>"
};
var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.Headers = headers;
request.ContentType = "application/json";
using(var streamWriter = new StreamWriter(request.GetRequestStream())) {
streamWriter.Write(JsonConvert.SerializeObject(body));
}
using(var response = (HttpWebResponse)request.GetResponse()) {
if (response.StatusCode == HttpStatusCode.OK) {
Console.WriteLine("Email sent successfully");
} else {
Console.WriteLine($ "Error sending email: {response.StatusCode} {response.StatusDescription}");
}
}
}
}
}
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import Foundation
struct EmailRequest: Encodable {
let from: From
let to: [To]
let subject: String
let text: String
let html: String
struct From: Encodable {
let email: String
let name: String
}
struct To: Encodable {
let email: String
let name: String
}
}
let headers = [
"accept": "application/json",
"Authorization": "Bearer [YOUR API KEY]",
"Content-Type": "application/json"
]
let body = EmailRequest(
from: EmailRequest.From(email: "your.email@example.com", name: "Your Name"),
to: [EmailRequest.To(email: "recipient.email@example.com", name: "Recipient Name")],
subject: "Greetings from MailPass!",
text: "This awesome message is brought to you by MailPass.",
html: "<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>"
)
let url = URL(string: "https://api.mailpass.app/v1/email")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = try! JSONEncoder().encode(body)
URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error sending email: (error.localizedDescription)")
return
}
guard let response = response as? HTTPURLResponse, response.statusCode == 200 else {
print("Error sending email: Invalid response")
return
}
print("Email sent successfully")
}.resume()
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
curl -X POST \
"https://api.mailpass.app/v1/email" \
--header "accept: application/json" \
--header "Authorization: Bearer [YOUR API KEY]" \
--header "Content-Type: application/json" \
--data-raw '{
"from": {
"email": "your.email@example.com",
"name": "Your Name",
},
"to": [
{
"email": "recipient.email@example.com",
"name": "Recipient Name",
},
],
"subject": "Greetings from MailPass!",
"text": "This awesome message is brought to you by MailPass.",
"html": "<h1>Hello Friend</h1><p>This awesome message is brought to you by MailPass.</p>",
}'
Every business selected to participate in the preview release will receive up to $1000 credit
Thank you for signing up!
We appreciate your feedback and support