Some additional comments that may help flesh this thread out a bit more:
if I use the SMTP support that is included in NodeBB, can I configure it to send the mail directly to the destination rather than via gmail or another intermediary?
I don't think SMTP works that way, it requires an intermediary mail server. What you're talking about is exactly what sendmail does my default.
Howsomever: Yes you may, depending on your configuration.
sendmail, the executable, will send mail via a variety of transports in keeping with the postal service mantra of "the mail must get thru".
man sendmail(8) speaketh thusly:
Sendmail sends a message to one or more recipients, routing the message over whatever networks are necessary. Sendmail does internetwork forwarding as necessary to deliver the message to the correct place.
..... snip, snip.....
With no flags, sendmail reads its standard input up to an end-of-file or a line consisting only of a single dot and sends a copy of the message found there to all of the addresses listed. It determines the network(s) to use based on the syntax and contents of the addresses.
If the recipient is not known locally, i.e. a local user/domain, then the server's resolver subsystem should, (once gain, depending on config) return the MX record for the domain at hand and attempt a delivery. Whether or not that MX accepts your mail is another matter, contingent upon their assessment of your server's legitimacy. At minimum you will need matching forward and reverse DNS enteries, and likely an SPF record, for example. Others will automatically put you on their blacklist even if your stuff is squeaky clean and require a near act of god to be removed.
Handling of refused, bounced, etc. mail is, once again, contingent upon configuration. One should ensure their mail queues do not become constipated to the extent undeliverable mail exhausts disk space, thereby effectively creating a DOS.
Hence, something seemingly as simple as mail delivery can pose more than a few sticky wickets and why I suggest following @julian et.al.'s advice up post. Unless you have a clear use case not to. Learning how to do all of this stuff is a legitmate use case. Just be forewarned that you may experience a bit of trial by fire if you are learning the zen of email administration on a production system.