Our customers love us
Sending messages through the SMTP relay
Transactional emails are automatic messages sent in response to a subscriber’s actions. Subscription or booking confirmation, order updates, notifications — these are all examples of transactional emails.
To send transactional emails via SMTP, enter a server address, port, login, and the password of your SendPulse account into your application.
<?php
use Sendpulse\RestApi\ApiClient;
use Sendpulse\RestApi\Storage\FileStorage;
$smtpSendMailResult = (new ApiClient('MY_API_ID', 'MY_API_SECRET', new FileStorage()))->post('smtp/emails', [
'email' => [
'html' => base64_encode('<p>Hello!</p>'),
'text' => 'text',
'subject' => 'Mail subject',
'from' => ['name' => 'API package test', 'email' => 'from@test.com'],
'to' => [['name' => 'to', 'email' => 'to@test.com']],
'attachments_binary' => [
'attach_image.jpg' => base64_encode(file_get_contents('../storage/attach_image.jpg'))
]
]]);
var_dump($smtpSendMailResult);
?>
sample.php hosted with ❤ by
github.com/sendpulse/sendpulse-rest-api-php
# SendPulse's Ruby Library: https://github.com/sendpulse/sendpulse-rest-api-ruby
require './api/sendpulse_api'
sendpulse_api = SendpulseApi.new(API_CLIENT_ID, API_CLIENT_SECRET, API_PROTOCOL, API_TOKEN)
email = {
html: '<p>Your email content goes here<p>',
text: 'Your email text version goes here',
subject: 'Testing SendPulse API',
from: { name: 'Your Sender Name', email: 'your-sender-email@gmail.com' },
to: [
{
name: "Subscriber's name",
email: 'subscriber@gmail.com'
}
]
}
sendpulse_api.smtp_send_mail(email)
sample.rb hosted with ❤ by
github.com/sendpulse/sendpulse-rest-api-ruby
# SendPulse's Python Library: https://github.com/sendpulse/sendpulse-rest-api-python
from pysendpulse import PySendPulse
if __name__ == "__main__":
TOKEN_STORAGE = 'memcached'
SPApiProxy = PySendPulse(REST_API_ID, REST_API_SECRET, TOKEN_STORAGE)
email = {
'subject': 'This is the test task from REST API',
'html': '<p>This is a test task from https://sendpulse.com/api REST API!<p>',
'text': 'This is a test task from https://sendpulse.com/api REST API!',
'from': {'name': 'John Doe', 'email': 'john.doe@example.com'},
'to': [
{'name': 'Jane Roe', 'email': 'jane.roe@example.com'}
]
}
SPApiProxy.smtp_send_mail(email)
sample.py hosted with ❤ by
github.com/sendpulse/sendpulse-rest-api-python
// SendPulse's Java Library https://github.com/sendpulse/sendpulse-rest-api-java
import com.sendpulse.restapi.Sendpulse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class Example {
public static void main(String[] args) {
Sendpulse sendpulse = new Sendpulse(API_CLIENT_ID, API_CLIENT_SECRET);
Map<String, Object> from = new HashMap<String, Object>();
from.put("name", "Your Sender Name");
from.put("email", "your-sender-email@gmail.com");
ArrayList<Map> to = new ArrayList<Map>();
Map<String, Object> elementto = new HashMap<String, Object>();
elementto.put("name", "Subscriber's name");
elementto.put("email", "subscriber@gmail.com");
to.add(elementto);
Map<String, Object> emaildata = new HashMap<String, Object>();
emaildata.put("html","Your email content goes here");
emaildata.put("text","Your email text version goes here");
emaildata.put("subject","Testing SendPulse API");
emaildata.put("from",from);
emaildata.put("to",to);
Map<String, Object> result = (Map<String, Object>) sendpulse.smtpSendMail(emaildata);
System.out.println("Result: " + result);
}
}
sample.java hosted with ❤ by
github.com/sendpulse/sendpulse-rest-api-java
// SendPulse's Node.JS Library: https://github.com/sendpulse/sendpulse-rest-api-node.js
var sendpulse = require("./api/sendpulse.js");
sendpulse.init(API_USER_ID, API_SECRET, TOKEN_STORAGE);
var email = {
"html" : "<p>Your email content goes here</p>",
"text" : "Your email text version goes here",
"subject" : "Testing SendPulse API",
"from" : {
"name" : "Your Sender Name",
"email" : "your-sender-email@gmail.com"
},
"to" : [ {
"name" : "Subscriber's name",
"email" : "subscriber@gmail.com"
} ]
};
var answerGetter = function answerGetter(data){
console.log(data);
}
sendpulse.smtpSendMail(answerGetter, email);
sample.js hosted with ❤ by
github.com/sendpulse/sendpulse-rest-api-//www.spcdn.org/node.js
#import "Sendpulse.h" // SendPulse's Obj-C Library https://github.com/sendpulse/sendpulse-rest-api-objective-c
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomethingWithTheData:) name:@"SendPulseNotification" object:nil];
Sendpulse* sendpulse = [[Sendpulse alloc] initWithUserIdandSecret:userId :secret];
NSDictionary *from = [NSDictionary dictionaryWithObjectsAndKeys:@"Your Sender Name", @"name", @"your-sender-email@gmail.com", @"email", nil];
NSMutableArray* to = [[NSMutableArray alloc] initWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:@"Subscriber's name", @"name", @"subscriber@gmail.com", @"email", nil], nil];
NSMutableDictionary *emaildata = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"<b>Your email content goes here</b>", @"html", @"Your email text version goes here", @"text",@"Testing SendPulse API",@"subject",from,@"from",to,@"to", nil];
[sendpulse smtpSendMail:emaildata];
}
- (void)doSomethingWithTheData:(NSNotification *)notification {
NSMutableDictionary * result = [[notification userInfo] objectForKey:@"SendPulseData"];
NSLog(@"Result: %@", result);
}
sample.m hosted with ❤ by
github.com/sendpulse/sendpulse-rest-api-objective-cSMTP API
SMTP API allows you to send transactional emails to subscribers from your website, CRM, or other web applications.
Email effectiveness reports
Measure email metrics regularly to improve your email marketing performance and ROI. All SendPulse reports — on open and click-through rates, inbox placement, delivery rates and errors, and spam complaints — are available for download.
Easy-to-use tools for sending transactional emails
Dedicated IP addresses
A dedicated IP address contributes to a better sender reputation and prevents your IP from being blacklisted.
SPF and DKIM authentication
SPF and DKIM records prevent transactional emails from landing in a spam folder.
List of unsubscribed contacts
Your emails won't be sent to unsubscribed contacts, even if they are on a mailing list.
Open and click tracking
Detailed reports help to evaluate and improve the effectiveness of your email marketing.
Custom tracking domain
Send out transactional emails without any mention of SendPulse in the email header and footer.
Webhooks
Receive information to your system about email status: delivered, undelivered, opened, and clicked.
FAQ
❔ What is an SMTP server?
The Simple Message Transfer Protocol is a method of exchanging information between a sender’s and a recipient’s servers. You can use the SendPulse SMTP server to send HTML emails separately from other features of our service.
💚 Why should I use an SMTP server?
An SMTP server allows you to send all sorts of transactional emails, e.g., confirmation emails, abandoned cart emails, shipping updates, notifications, etc. SendPulse’s SMTP server is reliable and has a high deliverability rate and sender reputation.
⚙️ How can I set up an SMTP server?
You need to register with SendPulse, fill in a simple profile form, and set up authentication parameters. Follow the guide and remember that our customer support team is always there to help.
💳 How much does it cost to use an SMTP server?
With SendPulse, you can send up to 12,000 free emails monthly. If you want to send a larger amount of emails via our SMTP server, you need to choose between two paid plans — “Monthly subscription“ or “Pay as you go.” Learn more about SMTP server pricing here.
or