# Node Red emailer and 0auth2- "ReferenceError: msg is not defined" function check

**URL:** <https://discourse.nodered.org/t/node-red-emailer-and-0auth2-referenceerror-msg-is-not-defined-function-check/86178>\
**Category:** General\
**Created:** [6 March 2024 05:50 UTC](https://discourse.nodered.org/t/node-red-emailer-and-0auth2-referenceerror-msg-is-not-defined-function-check/86178 "2024-03-06T05:50:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 March 2024 17:08 UTC](https://discourse.nodered.org/t/node-red-emailer-and-0auth2-referenceerror-msg-is-not-defined-function-check/86178/2 "2024-03-06T17:08:43Z")

</div>

@hadwll

I think this is a bug with the node - or at least its assumptions are incorrect.

@dceejay @Steve-Mcl

The node initializer is expecting an `msg` property - but during init, it will not exist?

**C'tor**

> <https://github.com/node-red/node-red-nodes/blob/fd027aa95a5c0847596a96705c3a05c969ae39a9/social/email/61-email.js#L30>

**Trying to use** `msg` **in there**

> <https://github.com/node-red/node-red-nodes/blob/fd027aa95a5c0847596a96705c3a05c969ae39a9/social/email/61-email.js#L82>

This would explain the error occurring during deploy?

IMO adjusting SMTP auth methods should be occurring on `input` ?  
certainly if auth values are to be taken from `msg`

I might be a little rusty - so forgive me, if i'm just talking rubbish

---

_[View the full topic](https://discourse.nodered.org/t/node-red-emailer-and-0auth2-referenceerror-msg-is-not-defined-function-check/86178)._
