Meteor email error for gmail server


meteor add email

inside server’s main.js, put the follwoing line inside for configuring email…
Meteor.startup(() => {

process.env.MAIL_URL = 'smtp://';


please use mail_user_name and password simple english character do not put any non alphabetical character as name or password like ‘amarmail01’ as username or ‘pass12345’ as a password. It may create problem.

for example, use something like the following example
say your email name:
password: amargmailpassword

Meteor.startup(() => {

process.env.MAIL_URL = 'smtp://';


[[ ]]

After configuring the email to send email one method can be written in the server side and the method can be called to send email…

sendEmail(to, from, subject, text) {
// Make sure that all arguments are strings.
// check([to, from, subject, text], [String]);
// Let other method calls from the same client start running, without
// waiting for the email sending to complete.
Email.send({ to, from, subject, text });
‘Hello from Meteor!’,
‘This is a test of Email.send.’

What is the question?

I can see that you forgot to URL encode the individual parts.

Try like this:

//SMTP setup
  smtp = {
    username: '',
    password: '****',
    server: '',
    port: 587
  process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;