Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- url: "script/mandrill.php"
- // data: {
- //
- // senderAddress: $scope.data.email
- // }
- }).then(function successCallback(response) {
- console.log("SENT", response);
- });
- <?php
- require "phpmailer.php";
- $mail = new PHPMailer;
- $mail->IsSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.mandrillapp.com'; // Specify main and backup server
- $mail->Port = 587; // Set the SMTP port
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'Spoonjar'; // SMTP username
- $mail->Password = 'V56qHZs7hK_7WDAcGSs6Ig'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
- $mail->From = 'notification@spoonjar.com';
- $mail->FromName = 'Your From name';
- $mail->AddAddress('notification@spoonjar.com', 'Josh Adams'); // Add a recipient
- $mail->AddAddress('ellen@example.com'); // Name is optional
- $mail->IsHTML(true); // Set email format to HTML
- $mail->Subject = 'Here is the subject';
- $mail->Body = 'This is the HTML message body <strong>in bold!</strong>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->Send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Message has been sent';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement