Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

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: nikhilv@smartgeek.in # The email account username, e.g. 'username@gmail.com'
pass: '*******' # The email account password, e.G. 'password'
event:
up: true
down: true
paused: false
restarted: false
message:
from: monitor@smartgeek.in # The message sender, e.g. 'Fred Foo foo@blurdybloop.com'
to: nikhilv@smartgeek.in # The message recipient, e.g. 'bar@blurdybloop.com, baz@blurdybloop.com'

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants