Foros del Web » Creando para Internet » CSS »

¿Se puede cargar un estilo CSS en un correo en formato HTML?

Estas en el tema de ¿Se puede cargar un estilo CSS en un correo en formato HTML? en el foro de CSS en Foros del Web. Buenas Mediante PHP envío correos con formato HTML a los usuarios. (con tablas, listas, imágenes....) Utilizo un include de un CSS que está en un ...
  #1 (permalink)  
Antiguo 11/12/2009, 16:51
Avatar de IMAC/  
Fecha de Ingreso: octubre-2005
Mensajes: 738
Antigüedad: 18 años, 6 meses
Puntos: 14
¿Se puede cargar un estilo CSS en un correo en formato HTML?

Buenas

Mediante PHP envío correos con formato HTML a los usuarios. (con tablas, listas, imágenes....)

Utilizo un include de un CSS que está en un sitio web:
Código HTML:
<link href="http://miweb.com/estilo.css" rel="stylesheet" type="text/css" /> 
Estoy enviadome el correo y no parece hacer efecto.

¿Estoy haciendo algo mal o simplemente no se puede cargar un CSS desde un correo?

Gracias de antemano.
  #2 (permalink)  
Antiguo 11/12/2009, 17:14
 
Fecha de Ingreso: diciembre-2009
Ubicación: España
Mensajes: 119
Antigüedad: 14 años, 4 meses
Puntos: 2
Respuesta: ¿Se puede cargar un estilo CSS en un correo en formato HTML?

En los mensajes de correo no se pueden añadir estilos CSS por desgracia.

Tienes que hacerlo como bien has dicho con tablas en vez de divisores. Practicamente para hacer este tipo de paginas tendras que hacerlo como se hacia antiguamente, hace como unos 10 años mas o menos.

Saludos.
  #3 (permalink)  
Antiguo 11/12/2009, 17:18
Avatar de IMAC/  
Fecha de Ingreso: octubre-2005
Mensajes: 738
Antigüedad: 18 años, 6 meses
Puntos: 14
Respuesta: ¿Se puede cargar un estilo CSS en un correo en formato HTML?

Muchas gracias por la respuesta Mr_Raymon, tocará poner los estilos en bruto...
  #4 (permalink)  
Antiguo 14/12/2009, 12:53
 
Fecha de Ingreso: diciembre-2009
Mensajes: 1
Antigüedad: 14 años, 4 meses
Puntos: 0
Respuesta: ¿Se puede cargar un estilo CSS en un correo en formato HTML?

Si se puede, yo acabo de hacer un correo que se envia solo y contiene datos sacados de una base de datos.

El agregar el estilo no funciona, pero prueba con poner los estilos en la misma pagina. te dejo un ejemplo:

Código PHP:
$from "Pedido <[email protected]>";
   
$subject "Orden de compra ";
   
$message "
   <style type=\"text/css\">
<!--
body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #333333;
}
.style1 {
    font-size: 16px;
    font-weight: bold;
}
.style2 {font-size: 14px}
.bordertabla {
    border: 1;
    border-style: solid;
    border-color: #333333;
}
.bordertabla2 {
    border: 1;
    border-color: #000000;
    border-style: solid;
    cellspacing: 0;
    cellpadding:0;
    
}
-->
</style>
<table width=\"768\" height=\"640\" class=\"bordertabla\">
  <tr>
    <td height=\"106\" width=\"252\" rowspan=\"3\"></td>
    <td height=\"106\" width=\"179\" rowspan=\"3\">&nbsp;</td>
    <td height=\"15\" width=\"193\"></td>
    <td height=\"17\" width=\"116\"></td>
  </tr>
  <tr>
    <td height=\"58\" width=\"193\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#333333\">
      <tr>
        <td width=\"183\" class=\"bordertabla\"><p align=\"center\"><strong>FECHA</strong></p></td>
      </tr>
      <tr>
        <td>$fecha</td>
      </tr>
    </table></td>
    <td height=\"58\" width=\"116\"><table width=\"115\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#333333\">
      <tr>
        <td width=\"107\"><p align=\"center\"><strong># CLIENTE</strong></p></td>
      </tr>
      <tr>
        <td>$num_cliente</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height=\"16\" width=\"193\">&nbsp;</td>
    <td height=\"16\" width=\"116\">&nbsp;</td>
  </tr>
  <tr>
    <td height=\"118\" width=\"252\" rowspan=\"5\">&nbsp;</td>
    <td height=\"19\" width=\"500\" colspan=\"3\">&nbsp;</td>
  </tr>
  <tr>
    <td height=\"20\" width=\"500\" colspan=\"3\">$nombre</td>
  </tr>
  <tr>
    <td height=\"18\" width=\"500\" colspan=\"3\">$direccion</td>
  </tr>
  <tr>
    <td height=\"20\" width=\"500\" colspan=\"3\">$ciudad</td>
  </tr>
  <tr>
    <td height=\"23\" width=\"500\" colspan=\"3\">$telefono</td>
  </tr>
  <tr>
    <td height=\"49\" width=\"252\"><table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#333333\">
      <tr>
        <td><div align=\"center\"><strong>CORREO ELECTRONICO</strong></div></td>
      </tr>
      <tr>
        <td>$mail</td>
      </tr>
    </table></td>
    <td height=\"49\" width=\"179\"><table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#333333\">
      <tr>
        <td><div align=\"center\"><strong>MODO DE ENTREGA</strong></div></td>
      </tr>
      <tr>
        <td>$select</td>
      </tr>
    </table></td>
    <td height=\"49\" width=\"315\" colspan=\"2\">&nbsp;</td>
  </tr>
  <tr>
    <td height=\"376\" width=\"758\" colspan=\"4\" valign=\"top\"><table width=\"757\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#333333\">
      <tr>
        <td width=\"135\"><div align=\"center\"><strong>CODIGO</strong></div></td>
        <td width=\"479\"><p align=\"center\"><strong>DESCRIPCIÓN</strong></p></td>
        <td width=\"121\"><p align=\"center\"><strong>CANTIDAD</strong></p></td>
      </tr>
      <tr>
        <td height=\"30\">$codp1</td>
        <td>$des1</td>
        <td>$can1</td>
      </tr>
      <tr>
        <td height=\"30\">$codp2</td>
        <td>$des2</td>
        <td>$can2</td>
      </tr>
      <tr>
        <td height=\"30\">$codp3</td>
        <td>$des3</td>
        <td>$can3</td>
      </tr>
      <tr>
        <td height=\"30\">$codp4</td>
        <td>$des4</td>
        <td>$can4</td>
      </tr>
      <tr>
        <td height=\"30\">$codp5</td>
        <td>$des5</td>
        <td>$can5</td>
      </tr>
      <tr>
        <td height=\"30\">$codp6</td>
        <td>$des6</td>
        <td>$can6</td>
      </tr>
      <tr>
        <td height=\"30\">$codp7</td>
        <td>$des7</td>
        <td>$can7</td>
      </tr>
      <tr>
        <td height=\"30\">$codp8</td>
        <td>$des8</td>
        <td>$can8</td>
      </tr>
      <tr>
        <td height=\"30\">$codp9</td>
        <td>$des9</td>
        <td>$can9</td>
      </tr>
      <tr>
        <td width=\"135\" $des10</td>
        <td width=\"121\">$can10</td>
      </tr>
    </table>
  </tr>
</table>"

Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:41.