tl;dr - SparkPost is a cloud email delivery service. It's easy to get started with either SMTP or their REST API.
SparkPost is the world’s #1 email delivery and analytics provider. Our customers send over 3 trillion messages a year, 37% of B2C and B2B email.
- Sign up for a SparkPost account
- Add and verify a sending domain
- Configure SMTP and save the password
Add this package using the following command
meteor add agoldman:sparkpost-mail
import { Meteor } from 'meteor/meteor';
import { Sparkpost } from 'meteor/agoldman:sparkpost-mail';
Meteor.startup(() => {
// configure Sparkpost
Sparkpost.config('YOUR SMTP PASSWORD');
// Send an email
Sparkpost.send({
from: 'postmaster@<YOUR SENDING DOMAIN>.com',
to: '[email protected]',
subject: 'Your Email Subject',
text: 'Message'
});
});
password
An SparkPost API Key that has SMTP permissionsusername
Username for SMTP account - defaults toSMTP_Injection
port
Port for SMTP - defaults to587
host
Host for SMTP - defaults tosmtp.sparkpostmail.com
from
Sets default sending email if none is specified in thesend
functionsubject
Sets default subject if none is specified in thesend
functionheaders
Sets default headers if none are specified in thesend
functionsecure
Boolean to set the connection tosmtps
orsmtp
. Defaults tofalse