PHP Mailer work with AJAX
Basic Mailer basic php mailer php <?php header('Access-Control-Allow-Origin: *'); header('Content-Type: application/json'); /* * CONFIGURE EVERYTHING HERE */ // an email address that will be in the From field of the email. $from = isset($_REQUEST['from']) ? $_REQUEST['from'] : 'example@mail.com'; $from = filter_var($from, FILTER_VALIDATE_EMAIL) ? $from : null; // an email address that will receive the email with the output of the form $sendTo = 'dimaslanjaka.superuser@blogger.com'; // subject of the email $subject = 'New message'; // form field names and their translations. // array variable name => Text to appear in the email $fields = array('name' => 'Name', 'surname' => 'Surname', 'phone' => 'Phone', 'email' => 'Email', 'message' => 'Message'); // message that will be displayed when everything is OK :) $okMess