Skip to content

Instantly share code, notes, and snippets.

@LeCoupa
Last active February 12, 2021 17:05
Show Gist options
  • Select an option

  • Save LeCoupa/9879221 to your computer and use it in GitHub Desktop.

Select an option

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;
});
@yauh

yauh commented Oct 16, 2014

Copy link
Copy Markdown

Should the lines inside the smtp object not be terminated with a comma , instead of a semicolon ;?

@LeCoupa

LeCoupa commented Oct 23, 2014

Copy link
Copy Markdown
Author

Yes that was a typo. Thank you!

@sahanDissanayake

Copy link
Copy Markdown

@LeCoupa, so with this I can send unlimited emails ? reliably ?

Is there a way to use my own server, rather than using google or sendgrid or anyother service ?

Thanks

@louwers

louwers commented Jul 28, 2016

Copy link
Copy Markdown

@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