Good morning,
I have the following code to send an email via PHPMailer.
<?php
$GetPost = filter_input_array(INPUT_POST,FILTER_DEFAULT);
$Erro = true;
$Tipo = $GetPost['tipo'];
$Nome = $GetPost['nome'];
$Email = $GetPost['email'];
$Telefone = $GetPost['telefone'];
$Cargo = $GetPost['cargo'];
$Curriculo = $_FILES['curriculo'];
$Mensagem = $GetPost['mensagem'];
include_once 'PHPMailer/class.smtp.php';
include_once 'PHPMailer/class.phpmailer.php';
$Mailer = new PHPMailer;
$Mailer->CharSet = "utf8";
$Mailer->SMTPDebug = 3;
$Mailer->FromName = "Jogo Digital";
$Mailer->From = "[email protected]";
$Mailer->AddAddress("[email protected]");
$Mailer->IsHTML(true);
$Mailer->Subject = "Novo currículo \"Trabalhe Conosco\" - {$Nome}";
$Mailer->AddAttachment($Curriculo['tmp_name'], $Curriculo['name']);
$Mailer->Body = "
Novo currículo enviado por {$Nome}<br />
Tipo: {$Tipo}<br /><br>
<b>Dados:</b><br /><br>
Email: {$Email}<br>
Telefone: {$Telefone}<br>
Cargo: {$Cargo}<br>
Mensagem: {$Mensagem}<br>
Curriculo: {$Curriculo}
";
if(!$Mailer->Send()){
echo "<script>alert('Não foi possível enviar, tente novamente!');window.history.back();</script>";
} else {
echo "<script>alert('Curriculo enviado com sucesso!');window.history.back();</script>";
}
What should I enter in this code so that the sending is done by smtp? Because the way it is now, all the emails are falling in SPAM.
Thank you!