Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $name = $_POST['name'];
- $email = $_POST['email'];
- $message = $_POST['message'];
- $from = 'Autor';
- $to = 'moj@mail.pl';
- $subject = 'Wiadomosc ze strony';
- $body = "Od: $name\n E-Mail: $email\n Wiadomosc:\n $message";
- if ($_POST['submit']) {
- if (mail ($to, $subject, $body, $from)) {
- print "<script>alert('Wiadomosc wyslana poprawnie');document.location.href='hhttp://www.example.pl/index.html';</script>";
- } else {
- print "<script>alert('Erorr');document.location.href='http://www.example.pl/index.html';</script>";
- }
- }
- ?>
- <form method="post" action="mailer.php">
- <input name="email" placeholder="Adres email" type="email" required autofocus>
- <input name="name" placeholder="Imię">
- <textarea placeholder="Wpisz tutaj treść wiadomości :)" name="message"></textarea>
- <input id="submit" name="submit" type="submit" value="Wyślij">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement