Forums

Give help. Get help.

  • # May 7, 2018 at 9:24 am

    I have a problem width sendmail.php and php mailer. When I push the button to send informations the page reload and remains on the same page and not redirect to the thank you page and the address of the page change from “www.website.com/page.php” to “www.website.com/page.php/sendmail.php”

    Here is the sendmail code:

    <?php
    
    if(isset($_POST['invia']))  {
    
        $nome = $_POST['nome'];
        $cognome = $_POST['cognome'];
        $telefono = $_POST['telefono'];
        $email = $_POST['email'];
        $sede = $_POST['sede'];
        $corso = $_POST['corso'];
        $corso_abbinato = $_POST['corso_abbinato'];
        $titolo_studio = $_POST['titolo_studio'];
        $messaggio = $_POST['messaggio'];    
    
        require '/phpmailer/PHPMailerAutoload.php';
    
        $mail = new PHPMailer;
    
    
        $mail->setLanguage('it', '/phpmailer/language/');
    
    
        $mail->From = 'peegiovanni@gmail.com';
        $mail->FromName = 'Scuola Internazionale di Comics';
        $mail->addAddress('peegiovanni@gmail.com', '[TOO]');     // Add a recipient
    
        $mail->isHTML(true);                                  // Set email format to HTML
    
        $mail->Subject = 'Contatti';
        $mail->Body    = 'Nome: ' . $nome . '<br> Cognome: ' . $cognome . '<br /> Email: ' . $email . '<br /> Telefono: ' . $telefono . '<br>Sede:' . $sede . '<br>Corso:' . $corso . '<br> Corso Abbinato:' . $corso_abbinato . '<br>Titolo di studio:' . $titolo_studio . '<br>Messaggio:' . $messaggio;
    
        $mail2 = new PHPMailer;
    
        $mail2->setLanguage('it', '/phpmailer/language/');
    
    
        $mail2->From = 'peegiovanni@gmail.com';
        $mail2->FromName = 'Scuola Internazionale di Comics';
        // $mail2->addAddress($email);     // Add a recipient
    
        // $mail2->isHTML(true);                                  // Set email format to HTML
    
        // $mail2->Subject = 'Richiesta Informazioni';
        // $mail2->Body    =   'html text';
    
    
        if(!$mail->send()) {
            $cod_errore = $mail->ErrorInfo;
            header("Location: /thank.html");
        } else if(!$mail2->send())  {
            $cod_errore = $mail2->ErrorInfo;
            header("Location: /thank.html");
        } else {
            header("Location: /thank.html");
        }
    
    }
    
    ?>
    
    
    # May 7, 2018 at 10:55 am

    Just asking: do you have a headers_senterror?

    # May 7, 2018 at 10:57 am

    No

    # May 7, 2018 at 10:59 am

    Just reload the page and I do not receive any mail and the page reload to the same one

    # May 13, 2018 at 3:42 am

    You have posted your php but your problem might be in your html. You say the problem is the redirect but is the rest of the form actually working?

    Take a look at the form action attribute in your HTML. Are you confident that is correct?

    # May 16, 2018 at 10:38 am

    Too late, I solved the issue. Thanks

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag