Php mailer embed image does not work

1

I'm trying to send an image in the body of the email with php mailer follow my cod:

$mail->AddEmbeddedImage("img/header.jpg", "img1","header.jpg", "base64", "image/jpg");

and in msg body html so

<img src='cid:img1'>

Nothing comes in gmail yahoo outlook. can someone help me?

    
asked by anonymous 23.09.2017 / 19:03

1 answer

-2

place exactly where the image is located:

$mail->AddEmbeddedImage("CAMINHO DO DIRETORIO 
    COMPLETO/img/header.jpg", 
    "img1","header.jpg", "base64", "image/jpg");

If you are going to use external HTML also place exactly where it is located:

file_get_contents('CAMINHO DO DIRETORIO COMPLETO/mail_templates/ARQUIVO.html'); 

If nothing is coming, maybe it is the configuration of your SMTP, I recommend sendgrid.com as SMTP

    
07.12.2017 / 19:06