Slide
Anonymous PHP mail function
Choose any sender's emailaddress (e.g., from: "me@whitehouse.org")
Syntax:
local-part / @ / domain
(where "domain" may be a domain name or an IP address enclosed in brackets)
see: https://en.wikipedia.org/wiki/Email_address#Examples
local-part / @ / domain
(where "domain" may be a domain name or an IP address enclosed in brackets)
see: https://en.wikipedia.org/wiki/Email_address#Examples
Source code
HTML
<form action="../ano-mail.php" method="post"> <input name="mailto" placeholder="@Mailto" class='input_login' size="50" type="text" /><br> <input name="from" placeholder="From" class='input_login' size="50" type="text" /> <br> <input placeholder="Subject" name="subject" class='input_login' size="50" type="text" /><br> <textarea name='body' placeholder="Body" class='input_body' rows='5' cols='55'></textarea><br> <input type="submit" class='input_login' value="Mail"/> </form>
PHP
<?php $headers = 'MIME-Version: 1.0' . "\n"; $headers .= "Content-type: text/html; charset=utf-8" . "\n"; $headers .= "Return-Path: <adminemail@yahoo.com>"."\n"; $headers .= "Errors-To: <adminemail@yahoo.com>"."\n"; // Additional headers //$headers .= "To: email1@yahoo.com <adminemail@yahoo.com>" . "\n"; //$headers .= "From: adminemail@yahoo.com <adminemail@yahoo.com>"; //-f parameter in mail function //$returnpath .= "adminemail@yahoo.com"; // Mail it $mailto = $_POST['mailto']; $subject = $_POST['subject']; $body = $_POST['body']; $from = $_POST['from']; mail("$mailto", "$subject","$body\n","From: $from\n", "-f $from" ); echo "<p>Mailed succesfully to <b>$mailto</b>, just remember this script is made for testing purposes only.<br><p>"; ?>