Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML/php email form issue

    Hi,

    I have a form to send emails that doesn't send the email in my mail box. Everything else seems to be ok. May someone help me please? Thanks!

    HTML

    Code:
    <section id="contact">
        <div class="outer_container">
          <div class="container">
            <div class="row">
              <div class="col col-md-5 col-sm-12"><h1>Contacter</h1></div>
              <div class="col col-md-7 col-sm-12 col-xs-12 center-row" id="contact_content">
                <form role="form" action="send.php" method="post" enctype="text/plain" class="center">
                  <div class="row">
                    <div class="col-md-6">
                      <div class="form-group">
                        <input name="fullname" type="text" class="form-control" id="input_name" placeholder="Name...">
                      </div>
                    </div>
                    <div class="col-md-6">
                      <div class="form-group">
                        <input name="email" type="email" class="form-control" id="input_email" placeholder="Email...">
                      </div>                
                    </div> 
                  </div>
                  <div class="row">
                    <div class="col-md-12">
                      <div class="form-group">
                        <textarea name="message" rows="3" class="form-control" id="input_message" placeholder="Message..."></textarea><br>
                        <button type="submit" class="btn btn-primary pull-right">Envoyer</button>
                      </div>
                    </div>
                  </div> <!-- row -->
                </form>          
              </div>
            </div>
          </div>
        </div>
      </section>

    php

    PHP Code:
    <?php

     
    /*
     * @Web Contact Page PHP Script
     * @author [EMAIL="helpvid@ymail.com"]helpvid@ymail.com[/EMAIL] - [URL="http://www.helpvid.net"]create a website dreamweaver[/URL]
     * @version 1.0.0
     * @date January  05, 2010
     * @category Helpvid PHP Script for Contact page
     * @copyright (c) 2010 @helpvid.net ([URL="http://www.helpvid.net"]create a website dreamweaver[/URL])
     * @Creative Commons Attribution-No Derivative Works 2.0 UK: England & Wales License.
     * @Creative Commons Attribution-No Derivative Works 2.5 UK: SCOTLAND License.
     * @Creative Commons Attribution-No Derivative Works 3.0 United States License.
     */


    /* Email Variables */

    $emailSubject 'send!'/*Make sure this matches the name of your file*/
    $webMaster 'francis.beaupre@hotmail.com';
     
        
    $email_subject "Message venant du site";

    /*design by Mark Leroy @ [URL]http://www.helpvid.net*/[/URL]

    /* Data Variables */
    $fullname $_POST['fullname'];
    $email $_POST['email'];
    $message $_POST['message'];



    $body = <<<EOD
    <br><hr><br>
    Nom: $fullname <br>
    Email: $email <br>
    Message: $message <br>
    EOD;
    $headers "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success mail($webMaster$emailSubject$body,
    $headers);


    /* Results rendered as HTML */
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="3;URL=http://frankskater.byethost7.com/">
    <style type="text/css">
    <!--
    body {
    background-color: #444; /* You can edit this CSS to match your website*/
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #fec001;
    text-decoration: none;
    padding-top: 200px;
    margin-left: 150px;
    width: 800px;
    }
    -->
    </style>
    </head>
    <div align="center">Merci pour votre message. Vous serez sur le site sous peu.</div>
    </div>
    </body>
    </html>
    EOD;
    echo 
    "$theResults";
    ?>
    Last edited by VIPStephan; 07-02-2014 at 09:53 AM. Reason: added code BB tags

  • #2
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well first I'm going to point you to the documentation for the php mail() function this explains it in more detail than I ever could. I also found where you copied your code from and going through the comments it seems they managed to find a solution so double check there maybe?

  • #3
    New Coder
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi frankskater,

    May you please elaborate a bit more on your issue and I'll be happy to help

    Kieran.

  • #4
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When I click on "Send" it looks like the email has been send and we are back on the web site after 3 seconds. But I never get that email in my hotmail adress. It just doesn't get there.

  • #5
    New Coder
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Mail does not support what you are trying to achieve here.

    I have found PHP Mail will only work with internal emails, as it has no SMTP support.

    To best achieve what you want here is to use PHPMailer, this has support for all of your needs.

    You can find PHPMailer here:
    https://github.com/PHPMailer/PHPMailer

    It's very simple to use, and very flexible.

    If you would like extra support with this I am happy to guide you into setting up, however the documentation should just about cover everything.

    Have a great day,

    Kieran.

  • #6
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you tried this on a web host and not just only on your oqn computer? Because some times the issue might be that you need a host with a virtual host and a emaiming service and of course a more later version of php such as PHP 5.

  • #7
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Emailing*


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •