HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   PHP Mail don't send HTML (http://www.howtoforge.com/forums/showthread.php?t=52228)

leo3d1 11th April 2011 05:59

PHP Mail don't send HTML
 
Hello, I'm Leo from Brazil and I have a server with Ubuntu 10.04 and ISPConfig 2.

I'm trying to send emails through mail() function, BUT when I recive in Outlook, it comes only in plain text, like:

"Content-type: text/html; charset=iso-8859-1
From: dfasdf@sigmatica.com.br
Message-Id: <20110411024409.8F704181FE@sigmatica.com.br>
Date: Sun, 10 Apr 2011 19:44:09 -0700 (PDT)
X-Antivirus: avast! (VPS 110410-1, 10/04/2011), Inbound message
X-Antivirus-Status: Clean

<html>
<body>

Nome: sdfsdfsdfsa<br>

E-mail: dfasdf<br>

Telefone: sdfsdf<br><br>

Mensagem: sadf
</body>
</html>"
This content comes in emails body. Why?

In my .php file I have:
"$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $email\n";

$subject = "Contato Site GS Móveis";

if(mail("leonardo@sigmatica.com.br","Contato Site GS Móveis","$msgOk","$headers")){
echo "<script>alert('Mensagem enviada!'); window.location=\"index.php\"</script>";
}else{
echo "<script>alert('Erro ao enviar!'); window.location=\"index.php\"</script>";
}"


I have already set headers, content type and a other things more, but NOTHING WORK!

Is something in php.ini?
I don't know what to do anymore.

I hope you can help me.

Thank you,
Leonardo A.

falko 11th April 2011 10:28

These links might help:
http://css-tricks.com/sending-nice-html-email-with-php/
http://www.phpbuilder.com/columns/ka...07.php3?page=1


All times are GMT +2. The time now is 05:21.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.