Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. import {Component, OnInit, ViewEncapsulation } from "@angular/core";
  2. import {Http} from "@angular/http";
  3. import { DialogComponent, DialogService } from "ng2-bootstrap-modal";
  4. import { Router } from '@angular/router';
  5. import { FormControl } from "@angular/forms";
  6. import { MapsAPILoader } from '@agm/core';
  7.  
  8. var email = require("emailjs/email");
  9.  
  10. @Component({
  11. selector: 'modal-demo',
  12. templateUrl: './demo.component.html',
  13. styleUrls: ['./demo.style.min.css', './flags16.css'],
  14. providers: [ DialogService ]
  15. })
  16.  
  17.  
  18. export class DemoComponent implements OnInit {
  19.  
  20. constructor(private router: Router, private http: Http){}
  21.  
  22. sendEmail(){
  23.  
  24. var server = email.server.connect({
  25. user: "primaryusername",
  26. password:"primpwd123",
  27. // host: "smtp.your-email.com",
  28. // ssl: true
  29. });
  30.  
  31. server.send({
  32. text: "i hope this works",
  33. from: "primaryemail@gmail.com",
  34. to: "secondaryemail@gmail.com",
  35. cc: "",
  36. subject: "testing emailjs"
  37. }, function(err, message) { console.log(err || message); });
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement