PHPMailer return success but email never got to my inbox

441 Views Asked by At

I'm using PHPMailer 5.2.28 and apparently it send the email (I'm getting the sucess page), but when I check my mail I'm not receiving it.

I've uploaded PHPMailer files on host and even then got nothing (i'm using kinghost).

My send.php code is

    <?php

require dirname(__FILE__) . '/inc/variaveisFixas.php';
require_once("envioForm/PHPMailerAutoload.php");

$emailBase = $emailCliente;


$mail = new PHPMailer(true);


$mail->From = $_POST['email'];
$mail->FromName = $_POST['name'];


$mail->addAddress($emailBase);



$mail->addReplyTo($emailCliente, '');


$mail->isHTML(true);

$mail->Subject  = "Formulário de Contato";
 $mail->Body .= " Nome: ".$_POST['name']."\r\n";
 $mail->Body .= " E-mail: ".$_POST['email']."\r\n";
 $mail->Body .= " Telefone: ".$_POST['number']."\r\n";
 $mail->Body .= " Mensagem: ".nl2br($_POST['message'])."";

$enviado = $mail->Send();
 
 $mail->ClearAllRecipients();
 
 if ($enviado) {
    header('Location: http://homolog.meumarketing.net/programas/teste/?mensagemenviada#faleconosco');
 } else {
    header('Location: http://homolog.meumarketing.net/programas/teste/?error#faleconosco');
 }

How can I solve this?

0

There are 0 best solutions below