• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP send mail

sabodden

Member
Joined
Sep 27, 2019
Messages
138
Reaction score
17
I want to make a donate form for my server, i follow a tutorial step by step to do it in php, but don't work
It is not showing any error, it's redirecting but not sending the e-mail...

Why?

code:
confirm.php
Code:
<form action="mail_donate.php" method="post">
  <label for="email">Your e-mail:</label><br>
  <input type="text" id="email" name="email"><br>
  
  <label for="character">Your character name:</label><br>
  <input type="text" id="character" name="character"><br>
  
  <label for="code">Certificate code:</label><br>
  <input type="text" id="code" name="code"><br>

  <label for="note">Note you want to send:</label><br>
  <input type="text" id="note" name="note"><br><br>

  <input type="submit" value="Submit">
</form>

mail_donate.php
Code:
<?php 
    if(isset($_POST['submit'])){
        $to = "[email protected]"; // this is your Email address
        $from = $_POST['email']; // this is the sender's Email address
        $subject = "donate [". $_POST['character'] . "]";
        $message = "Email: ". $_POST['email'] . "\nCharacter: " . $from . "\nCode: " . $_POST['code'] . "\nNote: " . $_POST['note'];

        $headers = "From:" . $from;
        mail($to,$subject,$message,$headers);
    }
    $host = $_SERVER['HTTP_HOST'];
    $extra = 'thank_you.php';
    header("Location: $extra");
?>
 
Top