balderdashy / sails-hook-email

Sails email hook
67 stars 34 forks source link

Usage with mailgun #10

Closed richmonkeys closed 9 years ago

richmonkeys commented 9 years ago

Hi. I'm trying to use this with mailgun but I am receiving the following error:

{ [SenderError: Mail from command failed - 501 Syntax error] name: 'SenderError', data: '501 Syntax error', stage: 'mail' }

My config/email.js is as follow:

module.exports.email = {
  service: 'mailgun',
  auth: {
    user: process.env.MAILGUN_SMTP_LOGIN,
    pass: process.env.MAILGUN_SMTP_PASSWORD
  },
  from: process.env.MAILGUN_SMTP_LOGIN,
  testMode: false
};

I can confirm that the environment variables are correct. I did try hard coding the credentials but doesn't seemed to work too.

I have tried using gmail and it works.

richmonkeys commented 9 years ago

Ok I found the problem. I need to manually set a "from" field for the mail options. I thought supposingly it will load the config "from" field if none is set.