Pedro Ferreira 0 Posted April 17, 2020 Report Share Posted April 17, 2020 Olá, sou iniciante em programação, e estou com este problema. Possuo este código em um formulário de contato, porem quando envio as informações dos campos o meu site o mesmo confirma que foi enviado com sucesso porem não chega nada para minha caixa de e-mail. O servidor smtp foi devidamente configurado em minha config.php require_once('lib/phpmailer/class.phpmailer.php'); try { $mail = new PHPMailer($GLOBALS['phpmailerdebug']); //New instance, with exceptions enabled $mail->IsSMTP(); // tell the class to use SMTP $mail->SMTPAuth = true; // enable SMTP authentication $mail->Port = $GLOBALS['smtp_port']; // set the SMTP server port $mail->Host = $GLOBALS['smtp']; // SMTP server $mail->Username = $GLOBALS['smtp_user']; // SMTP server username $mail->Password = $GLOBALS['smtp_passwd']; // SMTP server password $mail->AddReplyTo($GLOBALS['sendmail_from'],""); $mail->From = $GLOBALS['smtp_user']; $mail->FromName = "ADESG - Representa��o em Campinas"; $mail->AddAddress($GLOBALS['sendmail_from']); $mail->AddAddress("[email protected]"); $mail->Subject = $subject; $mail->AltBody = "Caso esteja visualizando esta mensagem, altere a configura��o de seu leitor de e-mail para aceitar e-mails com corpo HTML"; $mail->WordWrap = 80; // set word wrap $mail->IsMail(); $mail->MsgHTML($message); $mail->IsHTML(true); // send as HTML $mail->Send(); //header( 'Location: contato_enviado.php' ) ; echo "<br/><span align='center' style='color: red; font-size: 24px;'>"; echo "Solicitação envidada com sucesso!"; echo "</span><br/><br/>"; } catch (phpmailerException $e) { echo $e->errorMessage(); // Erros provenientes do PHPMailer } catch (Exception $e) { echo $e->getMessage(); // Outros erros } } Quote Link to post Share on other sites
Question
Pedro Ferreira 0
Link to post
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.