Skip to content
View in the app

A better way to browse. Learn more.

GamingCR

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ayuda con PHP Emailer Script

Featured Replies

Premisas:

  • Estoy conciente que podria usar un script ya hecho pero quiero hacer el mío. 
  • El código de envío de correo funciona
  • Tengo 2 preguntas en total pero voy a hacerlas 1 a la vez =p

Ahora si, mi primera duda.

El script (en esta parte) se supone que manda un correo con contenido en 2 partes, una texto simple y otra en HTML, esto para prevenir que aquellos que no puedan ver HTML se queden sin la info. Cuando mando un correo de prueba a gmail este muestra el correo como si estuviera en blanco, pero si lo descargo con Thunderbird sale el contenido HTML como debería.

Mi pregunta entonces es cómo hago para que se despliegue bien el HTML en clientes de correo electrónico (excepto yahoo que según leí ahí si funciona) o por lo menos que se despliegue la parte de texto. Ya encontré otra persona que tuvo este mismo problema pero la solución que le dieron ya estaba correcta en mi caso.

La parte pertinente del código que estoy usando:

[ $mail_final es el bloque de texto que se va a mandar en mail() ]

$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; 

$mail_delimitador = "--PHP-alt-" . $random_hash;

$mail_final = $mail_delimitador;
$mail_final .= "\r\nContent-Type: text/plain; charset=\"iso-8859-1\"";
$mail_final .= "\r\nContent-Transfer-Encoding: 7bit \r\n";
$mail_final .= $mail_message;
$mail_final .= "\r\n";
$mail_final .= $mail_delimitador;
$mail_final .= "\r\nContent-Type: text/html; charset=\"iso-8859-1\"";
$mail_final .= "\r\nContent-Transfer-Encoding: 7bit \r\n";
$mail_final .= $mail_HTML;
$mail_final .= "\r\n";
$mail_final .= $mail_delimitador;

Esta descargando la vara a Thunderbird por el acceso POP de Gmail o es otra direccion? Me inclinaria a pensar que es algun setting especifico de Gmail.

Edited by b52|Hunhau

  • Author

Probé con hotmail y parece que si funciona, debe ser algo de gmail tons. Si alguien sabe algún work around a eso se lo agradecería, por mientras voy a ir alistando la siguiente pregunta :P

Ya se lo mandé

Edited by Báhdom

Que contenia el correo? Veo el problema, pero hasta el source que despliega la vara esta vacio : / Si veo ese source solo sale

<html><head></head><body><div></div></body></html>

  • Author

<h1>texto</h1>

pero digamos que me lo mandé a mi mismo como BCC a hotmail y lo pude ver bien

a mi me funciona bien en hotmail, gmail y otros aparte de aplicaciones de correo con los headers de la siguiente manera:

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

solo utilizo esos dos aparte del from y funciona bien

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.