Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. $.ajax({
  2. type: "POST",
  3. url: "script/mandrill.php"
  4. // data: {
  5. //
  6. // senderAddress: $scope.data.email
  7. // }
  8. }).then(function successCallback(response) {
  9. console.log("SENT", response);
  10. });
  11.  
  12. <?php
  13.  
  14. require "phpmailer.php";
  15.  
  16. $mail = new PHPMailer;
  17.  
  18. $mail->IsSMTP(); // Set mailer to use SMTP
  19. $mail->Host = 'smtp.mandrillapp.com'; // Specify main and backup server
  20. $mail->Port = 587; // Set the SMTP port
  21. $mail->SMTPAuth = true; // Enable SMTP authentication
  22. $mail->Username = 'Spoonjar'; // SMTP username
  23. $mail->Password = 'V56qHZs7hK_7WDAcGSs6Ig'; // SMTP password
  24. $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
  25.  
  26. $mail->From = 'notification@spoonjar.com';
  27. $mail->FromName = 'Your From name';
  28. $mail->AddAddress('notification@spoonjar.com', 'Josh Adams'); // Add a recipient
  29. $mail->AddAddress('ellen@example.com'); // Name is optional
  30.  
  31. $mail->IsHTML(true); // Set email format to HTML
  32.  
  33. $mail->Subject = 'Here is the subject';
  34. $mail->Body = 'This is the HTML message body <strong>in bold!</strong>';
  35. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  36.  
  37. if(!$mail->Send()) {
  38. echo 'Message could not be sent.';
  39. echo 'Mailer Error: ' . $mail->ErrorInfo;
  40. exit;
  41. }
  42.  
  43. echo 'Message has been sent';
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement