Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (_SERVER["REQUEST_METHOD"] == "POST") {
- var _SERVER, mail_to;
- mail_to = "test@yopmail.com";
- var email;
- email = filter_var(trim(_POST["email"]), FILTER_SANITIZE_EMAIL);
- if (empty(email)) {
- http_response_code(400);
- console.log("Please complete the form and try again.");
- throw new Exit();;
- }
- #
- Mail Content
- var content;
- content += "New token demand\n\
- \n\
- ";
- content += "Email: " + email + "
- ";#
- email headers.
- var headers;
- headers = "From: New user";
- var success;
- success = mail(mail_to, subject, content, headers);
- if (success) {
- http_response_code(200);
- console.log("Thank You! Your message has been sent.");
- } else {
- http_response_code(500);
- console.log("Oops! Something went wrong, we couldn't send your message.");
- }
- } else {
- http_response_code(403);
- console.log("There was a problem with your submission, please try again.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement