Problems sending emails with PHPMailer

0

I change the color of the text, which is in the mail, when it was sent the first time it comes in black, but when it was sent a second time and it is attached in the same mail the one below appears with a purple color . Sent 1st time;

Code of the PHPMailer that I use to send the mail, I call it twice.

public function sendEmail(){
    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = "ssl";
    $mail->Host = "smtp.gmail.com";
    $mail->Port = 465;
    $instructorLider = mb_convert_case($nomLider, MB_CASE_TITLE, "UTF-8");
    $instructor = mb_convert_case($nomInstructor, MB_CASE_TITLE, "UTF-8");

    $mensaje = "PRIMER TEXTO, SI HAGO UN SALTO DE LINEA, EN EL SEGUNDO TEXTO APARECE MORADO, PERO NO
    EN EL PRIMERO <BR> SEGUNDO TEXTO, LA PRIMERA VEZ LLEGA BIEN LA SEGUNDA APARECE EL TEXTO CON SALTO MORADO.";
   // $mensaje = "HOLA AMIGOS COMO ESTAIS EH?";
    $mail->Username ='[email protected]';
    $mail->Password = 'nuevo-789'; 
    $mail->Subject = "Novedad";
    $mail->Body = $mensaje;
    $de = 'administracion'.$curso;
    $mail->setFrom('[email protected]','Administración');
    $mail->addAddress('[email protected]');
    $mail->addAddress('[email protected]');
    $mail->MsgHTML($mensaje);
    $mail->CharSet='UTF-8';

    if($mail->send()){
        echo "Enviado";
    }else{
        echo "Problemas al enviar error: ".$mail->ErrorInfo;
    }
    $mensaje = '';
}

Only this error occurs, when I use html code, in which the text makes a line break, for example with the paragraph tag

and with the ones, but the rest if I do not use any html the text color does not change no matter how many times I sent it

    
asked by R3d3r 82 16.11.2018 в 15:44
source

0 answers