Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error facing while using email plugin #354

Open
nikhilve99 opened this issue Feb 24, 2017 · 1 comment
Open

Error facing while using email plugin #354

nikhilve99 opened this issue Feb 24, 2017 · 1 comment

Comments

@nikhilve99
Copy link

Hi team,,
we have just configure uptime tool in our environment. its working properly but when we are enabling the plugin for email notification i am getting below error:


11:05:49 AM CTRLS - Deviceview EXE is now up
/root/uptime/node_modules/mongoose/lib/utils.js:413
throw err;
^

TypeError: this.mailcomposer.setMessageOption is not a function
at Nodemailer.setGeneralOptions (/root/uptime/node_modules/nodemailer/lib/nodemailer.js:238:23)
at Nodemailer.generateMailObject (/root/uptime/node_modules/nodemailer/lib/nodemailer.js:196:10)
at Nodemailer.sendMail (/root/uptime/node_modules/nodemailer/lib/nodemailer.js:184:10)
at /root/uptime/node_modules/nodemailer/lib/nodemailer.js:69:20
at Nodemailer.validateSettings (/root/uptime/node_modules/nodemailer/lib/nodemailer.js:173:5)
at sendMail (/root/uptime/node_modules/nodemailer/lib/nodemailer.js:63:12)
at Transport.transport.sendMail (/root/uptime/node_modules/nodemailer/lib/nodemailer.js:40:9)
at Promise. (/root/uptime/plugins/email/index.js:81:14)
at Promise. (/root/uptime/node_modules/mpromise/lib/promise.js:162:8)
at emitOne (events.js:96:13)


Here is my config/default.yaml file conf below:

plugins:

  • ./plugins/console
  • ./plugins/patternMatcher
  • ./plugins/httpOptions
  • ./plugins/email

- ./plugins/basicAuth

email:
method: SMTP # possible methods are SMTP, SES, or Sendmail
transport: # see https://github.com/andris9/nodemailer for transport options
service: Gmail # see https://github.com/andris9/Nodemailer/blob/master/lib/wellknown.js for well-known services
auth:
user: [email protected] # The email account username, e.g. '[email protected]'
pass: '*******' # The email account password, e.G. 'password'
event:
up: true
down: true
paused: false
restarted: false
message:
from: [email protected] # The message sender, e.g. 'Fred Foo [email protected]'
to: [email protected] # The message recipient, e.g. '[email protected], [email protected]'

The email plugin also uses the main url param for hyperlinks in the sent email.

=================================================================================
I have configured postfix mail server which is working properly.

Kindly help to resolve this issue.

Regards
Nikhil

@kimaniidaniel
Copy link

I got that error fixed by upgrading nodemailer to version 3.1.5 and changing a line in the plugin
nano ./uptime/plugins/email/index.js

var mailer = nodemailer.createTransport(config.transport);
//var mailer = nodemailer.createTransport(config.method, config.transport);

Check out my full tutorial here - http://www.kimaniidaniel.com/website-monitoring-using-headless-raspberry-pi/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants