title: React Send form data to email
body: <p>I am using create-react-app or my project. I created a form field where I store the data into the state. I would like to send the data as an email, and I'm lost on how to do so. </p>
  
  <p>One of the problems is using create-react-app, I'm not sure where to find my router or server page in node.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <pre><code>import React, { Component } from 'react';
  import { Button, Col, Grid, Row, Form, FormGroup, FormControl, 
  ControlLabel, Checkbox } from 'react-bootstrap';
  
  export class Contact extends Component {
      constructor(props) {
          super(props);
          this.state = {
              name: "",
              email: "",
              message: ""
          }
      }
  
      onChange = (e) =&gt; {
          const state = this.state;
          state[e.target.name] = e.target.value;
          this.setState(state);
      }
  
      onSubmit = (e) =&gt; {
          e.preventDefault();
          const { name, email, message } = this.state;
  
  
      }
  
  
  
  
      render() {
          const { name, email, message } = this.state;
          return(
              &lt;div&gt;
                  &lt;Grid&gt;
                      &lt;Row id="contactForm"&gt;
                          &lt;Col xs={2}&gt;
                          &lt;/Col&gt;
                          &lt;Col xs={8}&gt;
                              &lt;Form horizontal onSubmit={this.onSubmit}&gt;
                                  &lt;FormGroup &gt;
                                    &lt;Col componentClass={ControlLabel} sm={2}&gt;
                                      Name
                                    &lt;/Col&gt;
                                    &lt;Col sm={10}&gt;
                                      &lt;FormControl required value={name} name="name" type="name" 
                                      placeholder="Name" onChange={this.onChange} /&gt;
                                    &lt;/Col&gt;
                                  &lt;/FormGroup&gt;
  
                                  &lt;FormGroup controlId="formHorizontalPassword"&gt;
                                    &lt;Col componentClass={ControlLabel} sm={2}&gt;
                                      Email
                                    &lt;/Col&gt;
                                    &lt;Col sm={10}&gt;
                                      &lt;FormControl required value={email} name="email" type="email" 
                                      placeholder="Email" onChange={this.onChange}/&gt;
                                    &lt;/Col&gt;
                                  &lt;/FormGroup&gt;
  
                                  &lt;FormGroup&gt;
                                      &lt;Col componentClass={ControlLabel} bsSize="lg" sm={2}&gt;
                                          Message
                                      &lt;/Col&gt;
                                      &lt;Col sm={10}&gt;
                                          &lt;FormControl required value={message} name="message" componentClass="textarea" style={{ height: 200 }} 
                                          type="message" placeholder="Insert message here" onChange={this.onChange}/&gt;
                                      &lt;/Col&gt;
                                  &lt;/FormGroup&gt;
  
                                  &lt;FormGroup&gt;
                                    &lt;Col smOffset={2} sm={10}&gt;
                                      &lt;Checkbox&gt;Flag as important&lt;/Checkbox&gt;
                                    &lt;/Col&gt;
                                  &lt;/FormGroup&gt;
  
                                  &lt;FormGroup&gt;
                                    &lt;Col smOffset={2} sm={10}&gt;
                                      &lt;Button type="submit"&gt;
                                        Send
                                      &lt;/Button&gt;
                                    &lt;/Col&gt;
                                  &lt;/FormGroup&gt;
                              &lt;/Form&gt;
                          &lt;/Col&gt;
                          &lt;Col xs={2}&gt;
                          &lt;/Col&gt;
                      &lt;/Row&gt;
                  &lt;/Grid&gt;
              &lt;/div&gt;
          )
      }
  }
  </code></pre>