Php 使用html发送电子邮件不会';行不通

Php 使用html发送电子邮件不会';行不通,php,Php,我需要帮助。我的脚本发送电子邮件,但忽略html标记。有人能帮我吗 我的代码在这里: $to = "email@example.com"; $subject = 'Povolenie užívateľa'; $message = '<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" />

我需要帮助。我的脚本发送电子邮件,但忽略html标记。有人能帮我吗

我的代码在这里:

$to  = "email@example.com";
$subject = 'Povolenie užívateľa';
$message = '<html>
            <head>
                <meta http-equiv="content-type" content="text/html; charset=utf-8" />
            </head>
        <body>
        Užívateľ čaká na vaše schválenie.<br>Meno:$meno <br> Priezvisko:$priezvisko <br>
                                    Firma:$firma<br>
                                    E-mail:$email <br> V prípade ak chcete užívateľa povoliť kliknite na tento odkaz: 
                                    <a href="http://website.com/povolenie.php?r=$ret&povolenie=1" target="blank">povoliť</a> <br>
                                    Ak ho povoliť nechcete tak kliknite na tento odkaz: 
                                    <a href="http://website.com/povolenie.php?r=$ret&povolenie=0" target="blank">zakázať</a>"
        </body> 
            </html>';                                


 $headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; Charset=Windows-1250'       ."\r\n";                            
$headers = 'From: XXX<email@example.com>' . "\r\n" .               
"CC: email@example.com";
mail($to, $subject, $message, $headers);                 
$to=”email@example.com";
$subject='poovoleie užvateľa';
$message='1
乌西瓦塔克纳瓦什·施瓦莱尼。梅诺:$Meno
Priezvisko:$Priezvisko
菲尔玛:$Firma
电子邮件:$email
V prípade ak chcete užvateľa povoliťkliknite na tento odkaz:
在奥德卡兹附近的一个村庄: " '; $headers='MIME版本:1.0'。“\r\n”; $headers.='内容类型:text/html;Charset=Windows-1250'。“\r\n”; $headers='From:XXX'。“\r\n”。 “抄送:email@example.com"; 邮件($to、$subject、$message、$headers);
您的上一个标题已断开,缺少一个连接(句点)

做:

$headers.='From:XYZ'。“\r\n”。
“抄送:email@example.com";

非常感谢。现在它可以工作了。我还有一个问题。可以在消息中发送变量吗?以及如何发送?@user3706305不客气。请访问以下页面,向您展示如何关闭问题并将其标记为已回答/已接受-以回答您的第二个问题;您可以详细说明什么类型的变量?谢谢,但它已经工作了。我邮件正文中也有错误。在标记“我有用”之后,这就是为什么变量没有显示在邮件中的原因。@user3706305好的,很高兴听到它被完全解决了。如果您能将问题标记为已解决,我们现在可以结束提问,干杯。是的,当然。谢谢
$headers = 'From: XYZ <email@example.com>' . "\r\n" .               
"CC: email@example.com";
$headers .= 'From:...
         ^ right there
$headers .= 'From: XYZ <email@example.com>' . "\r\n" .               
"CC: email@example.com";