Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. var webpack = require('webpack');
  2. var LiveReloadPlugin = require('webpack-livereload-plugin');
  3.  
  4. module.exports = {
  5. target: 'node',
  6. entry:['./src/custom-script.js', './src/main.js'],
  7. output: {
  8. path: __dirname,
  9. filename: "build/bundle.js"
  10. },
  11. resolve: {
  12. extensions: ['', '.js', '.jsx', '.json', 'index.json']
  13. },
  14. module: {
  15. loaders: [
  16. {test: /.json$/, loader: "json-loader"},
  17. {
  18. test: /.jsx?$/,
  19. loader: ['babel-loader'],
  20. exclude: /node_modules/,
  21. query: {
  22. presets: ['react', 'es2015', 'stage-0']
  23. }
  24. }
  25. ]
  26. },
  27. plugins: [
  28. new webpack.DefinePlugin({
  29. 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
  30. }),
  31. new webpack.optimize.DedupePlugin(),
  32. new webpack.optimize.OccurenceOrderPlugin(),
  33. new LiveReloadPlugin()
  34. ]
  35. };
  36.  
  37. import React from 'react';
  38. import { render } from 'react-dom';
  39.  
  40. class SendMail extends React.Component {
  41. handleSubmit() {
  42. var send = require('gmail-send')({
  43. user: 'user@gmail.com', // Your GMail account used to send emails
  44. pass: 'abcdefghijklmnop', // Application-specific password
  45. to: '"User" <user@gmail.com>', // Send back to yourself
  46. // from: '"User" <user@gmail.com>' // from: by default equals to user
  47. // replyTo:'user@gmail.com' // replyTo: by default undefined
  48. subject: 'test subject',
  49. text: 'test text'
  50. // html: '<b>html text text</b>'
  51. });
  52.  
  53. send({
  54. subject: 'attached '
  55. }, function (err, res) {
  56. console.log('send(): err:', err, '; res:', res);
  57. });
  58. }
  59. render() {
  60. return (
  61. <div>
  62. <button className="button button-primary button-fluid" onClick={this.handleSubmit.bind(this)}>Send code</button>
  63. </div>
  64. );
  65. }
  66. }
  67.  
  68. export default SendMail;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement