Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>E-mail sender</title>
- <style type='text/css'>
- body
- {
- color:white;
- background-image:url('http://qfi.im/style/bg.png');
- font-family:comic sans ms;
- text-align:center;
- }
- .information
- {
- background:#171717;
- border-color:#E7E7E7;
- border-style:solid;
- border-width:1px;
- font-weight:bold;
- font-size:14px;
- }
- </style>
- </head>
- <body>
- <div class='information'>
- <form method='POST'>
- <table align='center'>
- <tr><td>To (email):</td><td> <input type='text' name='to'>
- <tr><td>From (name):</td><td> <input type='text' name='fromn'>
- <tr><td>From (email):</td><td> <input type='text' name='frome'>
- <tr><td>Subject:</td><td> <input type='text' name='subject'>
- <tr><td>Message:</td><td><textarea name='message' cols='35' rows='10'></textarea>
- <tr><td><input type='reset' value='Reset fields' name='reset'><td><input type='submit' value='Send e-mail' name='send'></td><td>
- </table>
- </form>
- </div>
- <?php
- if(isset($_POST['send']))
- {
- // variables
- $to = htmlentities(stripslashes($_POST['to']));
- $fromn = htmlentities(stripslashes($_POST['fromn']));
- $frome = htmlentities(stripslashes($_POST['frome']));
- $subject = htmlentities(stripslashes($_POST['subject']));
- $message = htmlentities(stripslashes($_POST['message']));
- $headers = "From: $fromn <$frome>";
- // variables
- if($to && $fromn && $frome && $subject && $message && $headers) {
- mail($to, $subject, $message, $headers);
- echo "E-mail successfully sent to: ", $to;
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment