Skip to content

Instantly share code, notes, and snippets.

@LeCoupa
Last active February 12, 2021 17:05
Show Gist options
  • Save LeCoupa/9879221 to your computer and use it in GitHub Desktop.
Save LeCoupa/9879221 to your computer and use it in GitHub Desktop.
Configure SMTP with Meteor --> https://github.com/LeCoupa/awesome-cheatsheets
# add the email package
meteor add email
// server/smtp.js
Meteor.startup(function () {
smtp = {
username: 'your_username', // eg: server@gentlenode.com
password: 'your_password', // eg: 3eeP1gtizk5eziohfervU
server: 'smtp.gmail.com', // eg: mail.gandi.net
port: 25
}
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
});
@louwers
Copy link

louwers commented Jul 28, 2016

@sahanDissanayake You can set up your own mail server, but it's quite hard (unless you use something like Mail-in-a-box) and it is generally discouraged, because your messages are much more likely to be marked as spam.

That said if you can rely on the SMTP server you can rely on this code to work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment