Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['kirim'])){
- $to="kimichi07@gmail.com@gmail.com";
- $subject='judul kirim email';
- $message=$_POST['pesan'];
- $header='Form: '.$_POST['email'];
- $headers = array();
- $headers[] = "MIME-Version: 1.0";
- $headers[] = "Content-type: text/plain; charset=iso-8859-1";
- $headers[] = "From: ".$_POST['email'];
- $headers[] = "Subject: {$subject}";
- $headers[] = "X-Mailer: PHP/".phpversion();
- $status=mail($to, $subject, $message, implode("\r\n", $headers));
- header("Location:".$_SERVER['PHP_SELF']."?msg=".($status?"email berhasil dikirim":"email gagal dikirim"));
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>kirim email</title>
- </head>
- <body>
- <?php echo isset($_GET['msg'])?"<h2>".$_GET['msg']."</h2>":'';?>
- <form action="" method="post">
- <table>
- <tr>
- <td>Your Email</td>
- <td><input type="text" name="email" /></td>
- </tr>
- <tr>
- <td>Your Massage</td>
- <td><textarea name="pesan"></textarea></td>
- </tr>
- <tr>
- <td colspan="2">
- <input type="submit" name="kirim" value="Send Massage"/>
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement