Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Wagner Martins - SC

Email em formato html

Recommended Posts

Olá,

 

Fiz um sistema de email para o usuario enviar um email para o site através de um formulario, só que pra mim aparace o email certinho (uso o outolook 2007) e no pc do cliente fica só os códigos do email (ele usa o outlook antigo) já que o emails é para ser mandado em formato html. O que posso fazer para resolver o problema?

 

Eis o meu código:

<?$nome = 		$_POST['nome'];$email = 		$_POST['email'];$telefone = 	$_POST['telefone'];$assunto =		$_POST['assunto'];$mensagem =		$_POST['mensagem'];$msg .= "<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd><html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /><title>Formulario de contato</title><style type=text/css>.tabela {font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;color:#666666;background: #ffffff;BORDER-RIGHT: #666666 1px dotted; BORDER-TOP: #666666 1px dotted; BORDER-LEFT: #666666 1px dotted; BORDER-BOTTOM: #666666 1px dotted; }</style></head><body><table width=600 height=600 border=0 class=tabela>  <tr>	<td valign=top></div>	<img src=topo.jpg width=600 height=150 /><br />	<br />	<strong>Nome:</strong> $nome <br />	<strong>Email:</strong> $email<br />	<strong>Telefone</strong>: $telefone<br /> 	<br />	<strong>Assunto:</strong> $assunto<br />	<br />	<br />	<table width=100% height=334 border=0>	  <tr>		<td valign=top><strong>Mensagem:</strong><br />$mensagem</td>	  </tr>	</table>	<div align=center><span class=links><a href=http://www.casamarketing.com.br target=_blank><img src=logo_casa.gif width=28 height=24 border=0 align=absmiddle /></a> © Direitos reservados - HSJB 2007</span></div></td>  </tr></table></body></html>";$cabecalho  = "MIME-Version: 1.0\r\n";$cabecalho .= "Content-type: text/html; charset=iso-8859-1\r\n";$cabecalho .= "From: $nome - $email";//mail("wawasurf@gmail.com", "Formulario de contato - Hsjb.com.br", $msg, $cabecalho);//mail("pauloconti@hjsb.com.br", "Formulario de contato - Hsjb.com.br", $msg, $cabecalho);mail("janaina@hsjb.com.br", "Formulario de contato - Hsjb.com.br", $msg, $cabecalho);?>

Obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tenta assim!

 

 

 

PHP
<?

 

$nome =         $_POST['nome'];

$email =         $_POST['email'];

$telefone =     $_POST['telefone'];

$assunto =        $_POST['assunto'];

$mensagem =        $_POST['mensagem'];

 

 

 

 

$msg = "

<html>

<head>

<title>Formulario de contato</title>

<style type=text/css>

.tabela {

font-size: 10px;

font-family: Verdana, Arial, Helvetica, sans-serif;

color:#666666;

background: #ffffff;

BORDER-RIGHT: #666666 1px dotted;

BORDER-TOP: #666666 1px dotted;

BORDER-LEFT: #666666 1px dotted;

BORDER-BOTTOM: #666666 1px dotted;

}

</style>

</head>

 

<body>

<table width=600 height=600 border=0 class=tabela>

  <tr>

    <td valign=top></div>

    <img src=topo.jpg width=600 height=150 /><br />

    <br />

    <strong>Nome:</strong> $nome <br />

    <strong>Email:</strong> $email<br />

    <strong>Telefone</strong>: $telefone<br />

    <br />

    <strong>Assunto:</strong> $assunto<br />

    <br />

    <br />

    <table width=100% height=334 border=0>

      <tr>

        <td valign=top><strong>Mensagem:</strong><br />

$mensagem</td>

      </tr>

    </table>

    <div align=center><span class=links><a href=http://www.casamarketing.com.br target=_blank><img src=logo_casa.gif width=28 height=24 border=0 align=absmiddle /></a> © Direitos reservados - HSJB 2007</span></div></td>

  </tr>

</table>

</body>

</html>";

 

$cabecalho  = "MIME-Version: 1.0rn";

$cabecalho .= "Content-type: text/html; charset=iso-8859-1rn";

$cabecalho .= "From: $nome<$email>";

 

 

 

//mail("wawasurf@gmail.com", "Formulario de contato - Hsjb.com.br", $msg, $cabecalho);

//mail("pauloconti@hjsb.com.br", "Formulario de contato - Hsjb.com.br", $msg, $cabecalho);

mail("janaina@hsjb.com.br", "Formulario de contato - Hsjb.com.br", $msg, $cabecalho);

 

 

?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tenta esse content, mas e so o email que nao aparece em html? Qual o email?

 

PHP
$cabecalho  = "MIME-Version: MSHTML 6.00.2900.3157rn";

$cabecalho .= "Content-Type: text/html; charset=windows-1252rn";

Compartilhar este post


Link para o post
Compartilhar em outros sites

Consiguir fazer aparacer o html no email sem aparcer o código, mais agora aparace como remetente desconhecido, você sabe me dizer pq?

 

Eis o código:

<?$nome = 		$_POST['nome'];$email = 		$_POST['email'];$telefone = 	$_POST['telefone'];$assunto =		$_POST['assunto'];$mensagem =		$_POST['mensagem'];//$to = "janaina@hsjb.com.br";//$to = "zedi@caiomartins.com.br";$to = "wawasurf@gmail.com";$subject = "Contato HJSB";$html = "<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd><html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /><title>Formulario de contato</title><style type=text/css>.tabela {font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;color:#666666;background: #ffffff;BORDER-RIGHT: #666666 1px dotted; BORDER-TOP: #666666 1px dotted; BORDER-LEFT: #666666 1px dotted; BORDER-BOTTOM: #666666 1px dotted; margin-top: 0px;}</style></head><body><table width=600 height=600 border=0 class=tabela>  <tr>	<td valign=top></div>	<img src=http://www.hsjb.com.br/contato/topo.jpg width=600 height=150 /><br />	<br />	<strong>Nome:</strong> $nome <br />	<strong>Email:</strong> $email<br />	<strong>Telefone</strong>: $telefone<br /> 	<br />	<strong>Assunto:</strong> $assunto<br />	<br />	<br />	<table width=100% height=334 border=0>	  <tr>		<td valign=top><strong>Mensagem:</strong><br />$mensagem</td>	  </tr>	</table>	<div align=center><span class=links><a href=http://www.casamarketing.com.br target=_blank><img src=http://www.hsjb.com.br/contato/logo_casa.gif width=28 height=24 border=0 align=absmiddle /></a> © Direitos reservados - HSJB 2007</span></div></td>  </tr></table></body></html>";$headers = "Content-type: text/html; charset=iso-8859-1\r\n";if (mail($to, $subject, $html, $headers)) {echo "<br /><br />Email enviado com sucesso para $to";} else {echo "Ocorreu um erro durante o envio do email.";}?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.