email sending #13

Closed
td00 wants to merge 5 commits from email into master
2 changed files with 25 additions and 0 deletions

View File

@ -45,5 +45,6 @@ Your password:<br>
<input type="submit" value="GO"> <input type="submit" value="GO">
</form> </form>
<a href="forgot.php">forgot password</a>
</body> </body>
</html> </html>

24
sendmail.php Normal file
View File

@ -0,0 +1,24 @@
<?php
//Thats not sendmail (the well known php function)
//It's merely a little try to reimplement some basic features for this project.
//And YES! I'm aware that this is hacky as shit!
//Sending Address:
$sender = 'forgotpassword@invalid.example.com';
//ReplyTo (should at least be valid!):
$replyto = 'spamme+somephpshit@td00.de';
session_start();
$mailrcpt = $_SESSION['mailrcpt'];
$mailsubject = $_SESSION['mailsubject'];
$mailbody = $_SESSION['mailbody'];
$to = $mailrcpt;
$subject = $mailsubject;
$message = $mailbody;
$headers = 'From: '.$sender.' '. "\r\n" .
'Reply-To: '.$replyto.' '. "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
<h1>Maybe there is a mail in your inbox now...</h1>