I have a problem because when I send an email with PHPMailer, the message arrives, everything is fine, except that the subject and name of the sender arrive with this text: =?utf-8?Q??=
I put the code, to see if you find any anomaly or solution, thanks!
$destinatario = "[email protected]";
$asuntoMail = utf8_decode("Petición por mail | www.xxxxxxxxxxxx.com.mx");
require("function/class.phpmailer.php");
$mail = new PHPMailer();
$mail->CharSet = "utf-8";
$mail->From = ($destinatario);
$mail->FromName = $fromName;
$mail->AddAddress($email);
$mail->AddCC($destinatario);
$mail->AddBCC("[email protected]");
// Aquí van los datos que apareceran en el correo que reciba
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = $asuntoMail;
$mail->Body = 'mensaje';
// Datos del servidor SMTP
$mail->SMTPDebug = 3;
$mail->IsSMTP();
$mail->Helo = "xxxxxxxxxxxxxxxxxxxxx";
$mail->Host = "xxxxxxxxxxxxxxxxxxxxx";
$mail->Port = 587;
$mail->Timeout = 60;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tsl';
$mail->Mailer = "smtp";
$mail->Username = "[email protected]"; // Correo Electrónico
$mail->Password = "xxxxxxxxxxxxxxx"; // Contraseña
if(!$mail->send()){
echo "Ocurrio un error: " . $mail->ErrorInfo." intentelo nuevamente";
} else {
echo "<p>¡Correo enviado!</p>";
}
I currently use version 5.5 which you can download from the official GitHub . After downloading the complete package, unzip and copy to your project only the
src
. Then create a filemail.php
( or whatever-name-you-prefer.php ) and use the following code: