0

Cuando envío un email hacia un correo, no se ve la imagen. Y cuando inspecciono el elemento me dice que tiene esta url:

<img style="display:block;margin-left:auto;margin-right:auto" src="https://ci3.googleusercontent.com/proxy/G_k4sW8WuFm52fEoztbRyL1LgS5wBSR9mXL25C5DlsYilkFfnQ=s0-d-e1-ft#http://img/img.jpg" class="CToWUd">

Y yo lo que envío es ésto:

<img style='display:block;margin-left: auto; margin-right: auto;' src='www.worknow-cursos.com/img/img.jpg' /></div>

Eh leído que google tiene un proxy propio para proteccion de imagenes pero no logo encontrar la solución. Acá dejo el mail:

$to = "Usuario <" . $user->email . ">";
        $subject = "Resolucion de trabajo practico para $user->name ";

        $message = "<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body style='font-family: 'arial';'>

<div style='width: 100%;margin-left: auto; margin-right: auto;background: #ffbb38; border-radius: 18px;display:block; float:center;'><h2 style='padding: 15px;color:#b22222; font-weight: bold; text-align: center'>INSTITUTO WORK NOW</h2> </div>
<p style='text-align: center; color: #4b5665; line-height: 21px; font-size: 18px;'><span style='font-size: 24px;'>Hola! C&oacute;mo estás?</span> <br>
¡Felicidades! tu trabajo pr&aacute;ctico est&aacute; aprobado </p>
<div style=''><img style='display:block;margin-left: auto; margin-right: auto;' src='www.worknow-cursos.com/img/img.jpg' /></div>
<p style='text-align: center; color: #4b5665; line-height: 21px; font-size: 18px;'>Cuando lo desees podes solicitar mas actividades.</p>
<div >
<table style='display: flex;justify-content: center;align-items: center;' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-del-min-width m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-tmpl-width' width='100%' cellpadding='0' border='0' cellspacing='0' bgcolor='#f9fafc' name='Layout_' id='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-Layout_' style='min-width:590px;width:590px'><tbody><tr><td class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-del-min-width' align='center' valign='top' bgcolor='#f9fafc' style='border-collapse:collapse;min-width:590px'><table width='590' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-container' cellpadding='0' border='0' align='center' cellspacing='0'><tbody><tr><td height='20' style='border-collapse:collapse;font-size:1px;line-height:1px'>&nbsp;</td></tr><tr><td valign='top' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-container-padding' align='left' style='border-collapse:collapse;font-size:14px;font-family:Arial,Helvetica,sans-serif;color:rgb(136,136,136)'><table width='100%' border='0' cellpadding='0' cellspacing='0' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-columns-container'><tbody><tr><td class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-force-col' valign='top' style='border-collapse:collapse;padding-right:20px;padding-left:20px'><table border='0' valign='top' cellspacing='0' cellpadding='0' width='264' align='left' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-col-2' style='border-bottom:0px'><tbody><tr><td valign='top' style='border-collapse:collapse'><table cellpadding='0' border='0' align='left' cellspacing='0' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-btn-col-content'><tbody><tr><td valign='middle' align='left' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-text-center' style='border-collapse:collapse;font-family:Arial,Helvetica,sans-serif'><div><div>Work Now Cursos<br>11 2694 2226<br>MDQ, CP7600<br>CABA, CP1428<br><a href='https://my.sendinblue.com/camp/showpreview/id/27#' style='color:rgb(102,102,102)' target='_blank' data-saferedirecturl='https://www.google.com/url?q=https://my.sendinblue.com/camp/showpreview/id/27%23&amp;source=gmail&amp;ust=1548339436236000&amp;usg=AFQjCNE2hiKhyGADz7Y2axjhkSAJmCyG-g'>[email protected]</a></div></div></td></tr></tbody></table></td></tr></tbody></table></td><td class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-force-col m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-social-width' valign='top' style='border-collapse:collapse;padding-right:15px'><table border='0' valign='top' cellspacing='0' cellpadding='0' width='246' align='right' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-last-col-2'><tbody><tr><td valign='top' style='border-collapse:collapse'><table cellpadding='0' border='0' cellspacing='0' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-social-align' align='right' style='float:right'><tbody><tr><td valign='middle' class='m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-text-center' width='85' align='right" style="border-collapse:collapse"><div class="m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-social-center"><table align="left" border="0" cellpadding="0" cellspacing="0" style="float:left;display:inline-block"><tbody><tr><td align="left" style="border-collapse:collapse;padding:0px 5px 5px 0px"><span style="color:rgb(255,255,255)"><a href="https://www.facebook.com/WorkNowarg/" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://www.facebook.com/WorkNowarg/&amp;source=gmail&amp;ust=1548339436236000&amp;usg=AFQjCNFFJjZzil1R7uXNXjZ-kRaC0MziWw"><img alt="Facebook" border="0" hspace="0" vspace="0" src="https://ci5.googleusercontent.com/proxy/lSkv6A04VUKQTkRddYrPg7o-Bxzozl9Bnl7XN-mOrPTzj4Ob7cz30iOTkj1vi9pDIWO79R2VHrfWCTtJHIVLVweWPw1H5v1qF4PkbXI44wvL=s0-d-e1-ft#http://img.mailinblue.com/new_images/rnb/theme5/rnb_ico_fb.png" style="vertical-align:top" class="CToWUd"></a></span></td></tr></tbody></table></div><div class="m_-3791644720194112676m_-5077930976808664309gmail-m_-7832111776023786876m_-1983291102630745082gmail-rnb-social-center"><table align="left" border="0" cellpadding="0" cellspacing="0" style="float:left;display:inline-block"><tbody><tr><td align="left" style="border-collapse:collapse;padding:0px 5px 5px 0px"><span style="color:rgb(255,255,255)"><a href="https://www.instagram.com/worknowarg/" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://www.instagram.com/worknowarg/&amp;source=gmail&amp;ust=1548339436236000&amp;usg=AFQjCNGfqWATRlLhzVpEf4J_BEAzLPjAQw"><img alt="Instagram" border="0" hspace="0" vspace="0" src="https://ci4.googleusercontent.com/proxy/cUFg0Ysnzaor5bg_lrB83LzjqQ_6OvYzqQOIyy27-K-CpmcJljVWiMxNEFx-TLweor4hVeMQgjibDkDMuY7TdG6HsSHdGypnKXcc0OxbYdFE=s0-d-e1-ft#http://img.mailinblue.com/new_images/rnb/theme5/rnb_ico_ig.png" style="vertical-align:top" class="CToWUd"></a></span></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td height="20" style="border-collapse:collapse;font-size:1px;line-height:1px">&nbsp;</td></tr></tbody></table></td></tr></tbody></table></div>

</body>
</html>

        ";

        ini_set("SMTP", "smtp.gmail.com");
        ini_set("sendmail_from", "[email protected]");
        ini_set("smtp_port", "465");
        // Always set content-type when sending HTML email
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

        // More headers
        $headers .= 'From: <[email protected]>' . "\r\n";
        $headers .= 'Cc: [email protected]' . "\r\n";

        mail($to,$subject,$message,$headers);

Aclaro el email se envía perfectamente, pero la imagen no se muestra.

6
  • porque no agregas toda la ruta:....worknow-cursos.com/img/img.jpg Commented el 23 ene. 2019 a las 17:02
  • 1
    te falta el "http://" Commented el 23 ene. 2019 a las 17:03
  • Ya lo pruebo y te digo
    – Juampi
    Commented el 23 ene. 2019 a las 17:03
  • 1
    Agrega http o https según el caso: src='http://www.worknow-cursos.com/img/img.jpg'
    – A. Cedano
    Commented el 23 ene. 2019 a las 17:05
  • Era el http. Increíble como no darse cuenta. Gracias !
    – Juampi
    Commented el 23 ene. 2019 a las 17:11

1 respuesta 1

1

Lo unico que te faltaria agregar es la ruta absoluta sea http:// ó https:// en tu caso la ruta quedaria algo asi:

http://www.worknow-cursos.com/img/img.jpg

en tu codigo seria:

<img style='display:block;margin-left: auto; margin-right: auto;' src='http://www.worknow-cursos.com/img/img.jpg' />

suerte..!!

1
  • Gracias Diego ! solucionado !
    – Juampi
    Commented el 23 ene. 2019 a las 17:34

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.