title: Send an Email Using React.js + Express.js
body: <p>I have built a web app using React.js in ES6. I currently want to create a basic "Contact Us" page and want to send an email. I am new to React and just discovered that I cannot actually send an email using React itself. I'm following the tutorial with <code>nodemailer</code> and <code>express-mailer</code> but have had some difficulty integrating the example code with my React files. Specifically, calling <code>node expressFile.js</code> works, but I have no idea how to link this to my React front-end. </p>
  
  <p>Nodemailer: <a href="https://github.com/nodemailer/nodemailer" rel="noreferrer">https://github.com/nodemailer/nodemailer</a></p>
  
  <p>Express-mailer: <a href="https://www.npmjs.com/package/express-mailer" rel="noreferrer">https://www.npmjs.com/package/express-mailer</a></p>
  
  <p>My React component for the form is below. How would I write an Express file so that it is called from the <code>contactUs()</code> method in my React component? Thanks!</p>
  
  <pre><code>import React from 'react';
  import {
    Col,
    Input,
    Button,
  Jumbotron
  } from 'react-bootstrap';
  
  class ContactView extends React.Component{
    contactUs() {
      // TODO: Send the email here
  
    }
    render(){
      return (
        &lt;div&gt;
      &lt;Input type="email" ref="contact_email" placeholder="Your email address"/&gt;
      &lt;Input type="text" ref="contact_subject" placeholder="Subject"/&gt;
      &lt;Input type="textarea" ref="contact_content" placeholder="Content"/&gt;
      &lt;Button onClick={this.contactUs.bind(this)} bsStyle="primary" bsSize="large"&gt;Submit&lt;/Button&gt;
    &lt;/div&gt;
  )
    }
  };
  
  export default ContactView;
  </code></pre>