PHP Mail don't send HTML

Discussion in 'Server Operation' started by leo3d1, Apr 11, 2011.

  1. leo3d1

    leo3d1 New Member

    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: [email protected]
    Message-Id: <[email protected]>
    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


    Nome: sdfsdfsdfsa<br>

    E-mail: dfasdf<br>

    Telefone: sdfsdf<br><br>

    Mensagem: sadf
    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("[email protected]","Contato Site GS Móveis","$msgOk","$headers")){
    echo "<script>alert('Mensagem enviada!'); window.location=\"index.php\"</script>";
    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.
  2. falko

    falko Super Moderator ISPConfig Developer

Share This Page