Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End modal form and phpmailer issue

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #241634
    ashlardev
    Participant

    I have a modal form that I am calling up on a page i am doing via an image click. the modal form comes up as it should, i can fill out the information, click submit and it goes to the “process.php” file to be emailed to me.

    The process.php file will return that the email has been sent, but it never comes.

    nothing echo’s back either when it states the message is sent.

    Below is the modal form code.

    ` <a data-toggle=”modal” data-target=”#myModal” href=”#”><img src=”http://ashlardev.byethost17.com/images/shoplevel.png&#8221; class=”img-square pull-right”></a>

          &lt;div class="modal fade custom-class" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
            &lt;div class="modal-dialog" role="document"&gt;
              &lt;div class="modal-content"&gt;
                &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;×&lt;/span&gt;&lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;Complete the form below to setup your &lt;br&gt;FREE account to view Le-Vel Products:&lt;/h4&gt;
                &lt;/div&gt;
                &lt;div class="modal-body"&gt;
    
    
                  &lt;form id="modal_feedback" method="POST" action="/process.php" accept-charset="UTF-8"&gt;
                  &lt;p&gt;&lt;label&gt;Your Name&lt;strong&gt;*&lt;/strong&gt;&lt;br&gt;
                  &lt;input type="text" autofocus required size="48" name="name" value=""&gt;&lt;/label&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;label&gt;Email Address&lt;strong&gt;*&lt;/strong&gt;&lt;br&gt;
                  &lt;input type="email" required title="Please enter a valid email address" size="48" name="email" value=""&gt;&lt;/label&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;label&gt;Telephone&lt;br&gt;
                  &lt;input type="tele" size="48" name="tele" value=""&gt;&lt;/label&gt;&lt;/p&gt;
                  &lt;/form&gt;
                &lt;/div&gt;
                &lt;div class="modal-footer"&gt;
                *This information will not be shared with anyone other than Le-Vel.
        &lt;a href="/process.php" class="btn btn-success" type="submit" value="Send!" id="submit"&gt;Submit&lt;/a&gt;
        &lt;a href="index5.html" class="btn btn-success" data-dismiss="modal"&gt;Nah.&lt;/a&gt;
    &lt;/div&gt;
    

    </div>
    </div>
    `

    here is my process.php code

    `<?php

    require_once(‘PHPMailerAutoload.php’);
    require_once(‘class.phpmailer.php’);
    require_once(‘class.smtp.php’);

    //include(“class.smtp.php”); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer();

    $mail->IsSMTP(); // telling the class to use SMTP

    $mail->Host = “smtp.openmailbox.org”; // SMTP server

    $mail->SMTPDebug = 1; // enables SMTP debug information (for testing)

    // 1 = errors and messages

    // 2 = messages only

    $mail->SMTPAuth = false; // enable SMTP authentication

    $mail->Host = “smtp.openmailbox.org”; // sets the SMTP server

    $mail->SMTPSecure = ‘TLS’; // Enable encryption, ‘ssl’ also accepted
    $mail->Port = 587; //Set the SMTP port number – 587 for authenticated TLS
    $mail->Username = “username”; // SMTP account username

    $mail->Password = “password”; // SMTP account password

    //add the recipient’s address here
    $myemail = ‘[email protected]’;
    $mail->addAddress(‘[email protected]’, ‘Ford Christopher’);
    //grab named inputs from html then post to #thanks
    if (isset($_POST[‘name’])) {
    $name = strip_tags($_POST[‘name’]);
    $email = strip_tags($_POST[’email’]);
    $tele = strip_tags($_POST[‘tele’]);
    $body = “this is the body of my message: $name, $email, $tele”;
    $email_subject = “Le-Vel Free Account Information”;
    //generate email and send!
    $headers = ‘From: ‘.$email”\r\n”.

    ‘Reply-To: ‘.$email”\r\n” .

    ‘X-Mailer: PHP/’ . phpversion();

    @mail($myemail, $email_subject, $body, $headers);
    }

    if($mail->send()) {
    echo ‘Message could not be sent.’;
    echo ‘Mailer Error: ‘ . $mail->ErrorInfo;
    echo $name;
    echo $email;
    echo $tele;
    echo $body;

    } else {
    echo ‘Message has been sent’;
    echo $name;
    echo $email;
    echo $tele;
    echo $body;
    }

    ?>
    `

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.