Meteor Tutorial
Meteor Useful Resources
Selected Reading
- Meteor - Best Practices
- Meteor - ToDo App
- Meteor - Running on mobile
- Meteor - Deployment
- Meteor - Structure
- Meteor - Publish & Subscribe
- Meteor - Package.js
- Meteor - Methods
- Meteor - Accounts
- Meteor - Sorting
- Meteor - Security
- Meteor - Assets
- Meteor - Email
- Meteor - HTTP
- Meteor - EJSON
- Meteor - Timers
- Meteor - Blaze
- Meteor - Check
- Meteor - Core API
- Meteor - Packages
- Meteor - Tracker
- Meteor - Session
- Meteor - Events
- Meteor - Forms
- Meteor - Collections
- Meteor - Templates
- Meteor - First Application
- Meteor - Environment Setup
- Meteor - Overview
- Meteor - Home
Meteor Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Meteor - Email
Meteor - Email
This package is used when you need to send an email from Meteor App.
Step 1 - Add Package
Open the command prompt window and run the following command −
C:UsersusernameDesktopmeteorApp>meteor add email
Step 2 - Mailgun Account
We need to create an account
. This is the default email provider for Meteor apps.After you are logged in, open the Domains tab and cpck the sandbox URL below the Domain Name. It will open a new page where we can find Default SMTP Login and Default Password. We will need these two for creating the MAIL_URL environment variable.
Send Email
To create a vapd MAIL_URL just insert your Mailgun credentials in place of YOUR_DEFAULT_SMTP_LOGIN and YOUR_DEFAULT_PASSWORD.
if (Meteor.isServer) { Meteor.startup( function() { process.env.MAIL_URL = "smtp://YOUR_DEFAULT_SMTP_LOGIN:YOUR_DEFAULT_PASSWORD@smtp.mailgun.org:587"; Email.send({ to: "toemailadress@email.com", from: "fromemailadress@email.com", subject: "Meteor Email", text: "The email content..." }); }); }
When you run the app, the email will be sent to your address.
![Meteor Email Received](/meteor/images/meteor-email-received.jpg)