SHARE
TWEET

Untitled

a guest Jul 18th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function doSendEmail (aData) {
  2.   var sData = JSON.stringify(aData)
  3.   $.post('dd-ajax.php', { m: 'sendEmail', sData: sData },
  4.     function () {})
  5.     .done(function () { console.log('Done') })
  6.     .fail(function (err) { showMessage(`unexpected error: ${err.responseText}`) })
  7.     .always(function () { spinner(false) })
  8. }
  9.      
  10. if ($method == "sendEmail") {
  11.     $sData = array_key_exists('sData', $_POST) ? $_POST['sData'] : NULL;
  12.  
  13.     foreach($sData as $line) {
  14.         $to = $line[7];
  15.         $name = $line[0];
  16.         $subject = 'Email Subject';
  17.         $message = `Dear $name, Blah blah blah`;
  18.         mail($to, $subject, $message);
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top