Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post" action="index.php">
- <div class="row 50%">
- <div class="6u 12u(mobile)"><input name="name" type="text" placeholder="Name" /></div>
- <div class="6u 12u(mobile)"><input name="email" type="text" placeholder="Email" /></div>
- </div>
- <div class="row 50%">
- <div class="12u"><textarea name="message" placeholder="Message"></textarea></div>
- </div>
- <div class="row">
- <div class="12u">
- <ul class="actions">
- <li><input type="reset" class="button alt" value="Clear Form" /></li>
- <li><input name="submit" type="submit" class="button" value="Send Message" /></li>
- </ul>
- </div>
- </div>
- </form>
- <?php
- if (isset($_POST["submit"])) {
- $name = $_POST['name'];
- $email = $_POST['email'];
- $message = $_POST['message'];
- $from = 'Demo Contact Form';
- $to = "xxxxx@gmail.com";
- $subject = 'Message from Contact Demo ';
- $body = "From: $namen E-Mail: $emailn Message:n $message";
- if (mail ($to, $subject, $body, $from)) {
- $result='Thank You! I will be in touch';
- echo 'test success';
- } else {
- $result='Sorry there was an error sending your message.';
- }
- }
- ?>
- mail function
- ; For Win32 only.
- ; http://php.net/smtp
- ; SMTP=smtp.gmail.com
- ; http://php.net/smtp-port
- ; smtp_port=25
- ; For Win32 only.
- ; http://php.net/sendmail-from
- ; sendmail_from = your@gmail.com
- ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
- ; http://php.net/sendmail-path
- sendmail_path = ""C:xamppsendmailsendmail.exe" -t"
- sendmail
- smtp_server=smtp.gmail.com
- smtp_port=465
- error_logfile=error.log
- debug_logfile=debug.log
- auth_username=your@gmail.com
- auth_password=yourpassword
- force_sender=your@gmail.com
- hostname=localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement